-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support polymorphic objects #193
Conversation
Fix polymorphic object issue: rpkilby#101
@ubaumann could you add a test for your fix and ensure it fails if you revert your patch? |
I can confirm this appears to fix #101. Without this change, JSON fields on parents don't get deserialized properly and are returned as strings instead. The problem with this change is that |
@youssefm Thank you. I hadn't considered that. @nemesisdesign I can add some test but it would add the dependency |
@nemesisdesign Should I add some tests? The fix is working well in our production environment. |
I'm not a maintainer of this package, but unless django-polymorphic is too heavy, I would add it only as a dependency for the build. This kind of dependency is usually added in a file called Alternatively it can be added directly here: https://github.com/dmkoch/django-jsonfield/blob/master/.travis.yml#L36 |
Hi All, my project depends on this PR, is there anything I can help with to get it merged? |
Just my two cents here - the current fix may address the specific issue with It seems to me that it would make more sense to fix the broader issue here rather than trying to detect instances of a particular library in order to treat them differently. |
Hi all. I've added tests that ensure that jsonfield is compatible with MTI inheritance. If you have any further issues, please let me know. Thanks! |
Fix polymorphic object issue: #101
With polymorphic objects I get a
AttributeError
onobj.pk
.obj.id
works fine.pk
andid
has in the tests always the same value.