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.

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).

Project details

Uploaded py3