Skip to main content

Overridable foreign key fields for Proxy models

Project description

Allow overriding foreign key fields on Proxy models.

Mostly, you won’t want to do this. However, I did have a situation where it would be useful, mainly for reducing the numbers of queries I was having to run.

You can read about it at: http://schinckel.net/2015/05/13/django-proxy-model-relations/

Usage is pretty simple:

from proxy_overrides.related import ProxyForeignKey

class ProxyModel(ParentModel):
    related = ProxyForeignKey(OtherProxyModel)

You may only override fields that exist, although in the future, it may be possible to create a relation with a different name (enabling you to keep the standard relation to the non-proxy model).

You may also only override with a compatible field, and can only point to another proxy model (and only one proxy model may point to any other given proxy model).

It is also possible to override non-related models, but I’m not that interested in that use case at the moment.

Project details


Download files

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

Source Distribution

django-proxy-overrides-0.2.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

django_proxy_overrides-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file django-proxy-overrides-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django-proxy-overrides-0.2.0.tar.gz
Algorithm Hash digest
SHA256 64388dbe8aac95b4b04fd01ae0f5ef3d8e49a55467d6428b071347fddc92ca72
MD5 55ab3cdc6d5f639fb35b2b164f23ec36
BLAKE2b-256 2835a0939a508b83c62941ae65f52d0701af7bec11d38de94451cb0fd1339447

See more details on using hashes here.

File details

Details for the file django_proxy_overrides-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_proxy_overrides-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a1024c6793731f690ded18f2ebaf56d5a491727db0f2c58eaf457730d9fa04a
MD5 d2d44597c61c86423726633dcb81e655
BLAKE2b-256 5f9c310e2d9255bae3b6e582a1f31ff53f22116baf4956d3bc969328c4dd515f

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