Skip to main content

Overridable fields for Proxy models

Project description

Allow overriding 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:

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-proxy-overrides-0.1.0.tar.gz
Algorithm Hash digest
SHA256 85708d7ff47392b0a7337942a22b9dbb4ff40118b95426dd44bb83b87975339d
MD5 2dafdf3896b97678a4df2c25d46fb046
BLAKE2b-256 e1540e9586f26bbb6788d23849dbe32501a1f56b50bce74f733545d5053e627a

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