You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version < 5 django-polymorphic proxy models are tagged with the ContentType of the model class used to create the database row even if that model class was a proxy model. Then, by default, the QuerySets use instance_of to filter for proxy instances only when accessed from a proxy class. This creates a lot of confusion because the normal Django use case for proxies involves creating the rows from the concrete class then accessing them from proxy classes in different contexts. Confusion results when the proxy QuerySets are empty (#376, #390).
One approach to proxy models in django-polymorphic would have been to never use proxy ContentTypes. Changing the current behavior would probably be too fraught even for a major version update and there are also legitimate uses cases for knowing if a row was created from a proxy or not.
I think the decision for version 5 is therefore more along the lines of - should polymorphic_proxy be set to True by default when proxy is set.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
See #676
In version < 5 django-polymorphic proxy models are tagged with the ContentType of the model class used to create the database row even if that model class was a proxy model. Then, by default, the QuerySets use
instance_ofto filter for proxy instances only when accessed from a proxy class. This creates a lot of confusion because the normal Django use case for proxies involves creating the rows from the concrete class then accessing them from proxy classes in different contexts. Confusion results when the proxy QuerySets are empty (#376, #390).One approach to proxy models in django-polymorphic would have been to never use proxy ContentTypes. Changing the current behavior would probably be too fraught even for a major version update and there are also legitimate uses cases for knowing if a row was created from a proxy or not.
I think the decision for version 5 is therefore more along the lines of - should polymorphic_proxy be set to True by default when proxy is set.
Beta Was this translation helpful? Give feedback.
All reactions