-
Notifications
You must be signed in to change notification settings - Fork 301
DRAFT: Polymorphism post and patch support #240
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
Conversation
Thanks @ograycode, looks great! Indeed, my preliminary work was not complete then definitely not merge-able. I'm thrilled that there's so much interest in polymorphic support these days. |
@@ -9,7 +9,6 @@ | |||
class Migration(migrations.Migration): | |||
|
|||
dependencies = [ | |||
('contenttypes', '0002_remove_content_type_name'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
('contenttypes', '0001_initial'),
is still needed: 0002
has been introduced in Django 1.8 and 1.7 is still supported by the lib (btw shouldn't support be dropped since it reached its end of life @jerel ?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had removed it because I thought the dependency was breaking the older django versions (<1.7) on test. I think I'm wrong though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It breaks on Django 1.7 since migration 0002
does not exist (added in 1.8). But for the purpose of this migration, the initial content type migration seems fine as a dependency.
@leo-naeka great to see your response. I'll clean up the git history in my repo this afternoon. Then you should be able to base any additional work you do on it. Once the git cleanup is done, you can submit pull requests against my repo and I'll merge them into the |
- support for post and patch request on polymorphic model endpoints. - makes polymorphic serializers give child fields instead of its own.
@leo-naeka I have cleaned up the git history of this branch. I don't plan on doing any more interactive rebases, so it can be worked on you now. |
Thanks @ograycode! For the moment, I'll fork your code, then fill you some PR. You may want to give me the collaborator status later, if necessary. |
Update gitignore
Polymorphism improvements
my colleague @tpilara will be taking over for me and will be working towards completing this. |
Any progress on this patch @ograycode and @tpilara? If not then can you outline what is missing and how we can get in a better merge state. We haven't tested it yet on our code base, but we would like to help if possible. |
Since I'm the main developer on this and I want to move forward (but having no permissions on ZeroCater/django-rest-framework-json-api), I propose to take the lead and continue with this on my original PR #211. Then, this one could be closed. cc @stianpr |
@leo-naeka I work at ZeroCater with @ograycode and @tpilara. We replaced our polymorphic models, so it's best if you take over this. |
This is based off of @leo-naeka's pull #211, and I do not consider it merge-able in it's current state. That said, I wanted to get early feedback from this project's maintainers on the direction of the pull request as well as know what I can do to help get this functionality in.
The pull request builds on #211 in the following ways:
patch
requests on a polymorphic model's-detail
endpoint.post
requests on a polymorphic model's-list
endpoint.includes
json structure and-detail
json structure to use fields defined by the polymorphic serializer's child fields property.TODO:
relationship
endpoints.ProjectSerializer
into a more generic polymorphic serialize.# b
comment.(I did this work because #211 had not been updated in about a month and my team was running up against this issue).