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
This is different but complementary to issue #481 : when a serializers.PrimaryKeyRelatedField's queryset points to a one2one related field (such as when using django polymorphic) one should resolve recursively the type of the field, and not as a string.
Rationale: django polymorphic models inheritance by having a one2one relation between the child model's pk and its parent's pk.
Such inheritance chains can be arbitrarily long, so the only solution I could find was writing a recursive implementation (but maybe the base type can be extracted without recursion?) which I will send as a PR hoping it is useful.
Edit: PR #560
The text was updated successfully, but these errors were encountered:
pbrenna
pushed a commit
to pbrenna/drf-yasg
that referenced
this issue
Mar 18, 2020
This is different but complementary to issue #481 : when a serializers.PrimaryKeyRelatedField's queryset points to a one2one related field (such as when using django polymorphic) one should resolve recursively the type of the field, and not as a string.
Rationale: django polymorphic models inheritance by having a one2one relation between the child model's pk and its parent's pk.
Such inheritance chains can be arbitrarily long, so the only solution I could find was writing a recursive implementation (but maybe the base type can be extracted without recursion?) which I will send as a PR hoping it is useful.
Edit: PR #560
The text was updated successfully, but these errors were encountered: