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 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.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_proxy_overrides-0.2.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django-proxy-overrides-0.2.1.tar.gz
Algorithm Hash digest
SHA256 58a1c686f50e91cbb9d2898bc3e2cb2bc5b57af0012a2bff9dad929d4f97626e
MD5 f25adbf68604bb627c64dd5e155a8220
BLAKE2b-256 c4b09298275c6e507f6eb0dfb75df3a5fd53bea2983e1af3ad21c2d50b476780

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_proxy_overrides-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b77ddf52884d3ef333f811b64af50a0eeb43892e56b95b4ca7a04794c24fd60f
MD5 5fdec85cfb9da9bf216566dd2c4104c9
BLAKE2b-256 6e106a07a390808589b7a767d4abb09e22d24e3bda70a419909c85e634d56959

See more details on using hashes here.

Supported by

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