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
Support for Polymorphic models have been added through PR #211 in 2017.
Recently, we had the issue #1190 opened stating that includes do not work with Django Polymorphic integration. As compound documents is a core feature of DJA I was wondering who is actually using Django Polymorphic at all with DJA nowadays? When going back to the original PR, there was only code review discussion. As far as I can see, there was no discussion on why Django Polymorphic should be added to DJA at all and what use cases it covers.
Why I am starting this discussion is that how Polymorphic has been implemented in DJA increased the complexity of Django JSON API especially the renderer and some util functions. This increased maintenance burden and also recently, we had to add workarounds to get new Python version support (#1185) as Django Polymorphic has not been updated for a while. Although as Django Polymorphic has been moved to Jazzband that might improve, hopefully.
Personally, to avoid additional complexity to DJA for an optional feature, I think a Django REST framework Polymorphic would be best added in a third party app like django-restframework-json-api-polymprohic or similar. This way it certainly won't interfere with DJA core features and would help improve the API of the whole DJA library as well.
However, before we make any decision, I want to ask that the people who use Django Polymorphic with Django REST framework JSON:API speak up what there are exactly using it for. That would be very helpful to make a good decision on how to move forward.
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
-
Support for Polymorphic models have been added through PR #211 in 2017.
Recently, we had the issue #1190 opened stating that includes do not work with Django Polymorphic integration. As compound documents is a core feature of DJA I was wondering who is actually using Django Polymorphic at all with DJA nowadays? When going back to the original PR, there was only code review discussion. As far as I can see, there was no discussion on why Django Polymorphic should be added to DJA at all and what use cases it covers.
Why I am starting this discussion is that how Polymorphic has been implemented in DJA increased the complexity of Django JSON API especially the renderer and some util functions. This increased maintenance burden and also recently, we had to add workarounds to get new Python version support (#1185) as Django Polymorphic has not been updated for a while. Although as Django Polymorphic has been moved to Jazzband that might improve, hopefully.
Personally, to avoid additional complexity to DJA for an optional feature, I think a Django REST framework Polymorphic would be best added in a third party app like django-restframework-json-api-polymprohic or similar. This way it certainly won't interfere with DJA core features and would help improve the API of the whole DJA library as well.
However, before we make any decision, I want to ask that the people who use Django Polymorphic with Django REST framework JSON:API speak up what there are exactly using it for. That would be very helpful to make a good decision on how to move forward.
Thanks for your feedback.
Beta Was this translation helpful? Give feedback.
All reactions