Skip to main content

Arbitrary django model joining

Project description

Usage:

```python
from django.db import models
from django_joining import JoiningKey


class ModelA(models.Model):

foo = models.IntegerField()
bar = models.IntegerField()
baz = models.TextField()

model_b = JoiningKey('ModelB',
from_fields=['foo', 'bar'],
to_fields=['qux', 'quux'],
related_name='model_a_set'
)


class ModelB(models.Model):

qux = models.IntegerField()
quux = models.IntegerField()
quuux = models.TextField()



ModelA.objects.filter(model_b__quuux='test').select_related('model_b')

...

ModelB.objects.prefetch_related('model_a_set')

...

```


Project details


Release history Release notifications | RSS feed

This version

0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_joining-0.3-py2.py3-none-any.whl (3.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django_joining-0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_joining-0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6fd1c653f8efa92cc0e894457e1f776314ed43b97bc081874f57410b2efa0c99
MD5 dc4e713649d49aba1fbba79f318a70a1
BLAKE2b-256 c51e71518107160123ecf785c67d5baa241f6b7e2933b6cae87a97d9bcc6dc52

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page