Skip to content
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

rest: clean up ModelSerializer.get_default_fields #22

Closed
sheppard opened this issue Mar 19, 2014 · 2 comments · Fixed by #34
Closed

rest: clean up ModelSerializer.get_default_fields #22

sheppard opened this issue Mar 19, 2014 · 2 comments · Fixed by #34

Comments

@sheppard
Copy link
Member

The multiple interwoven use cases are getting a bit out of hand. Probably should break down and have multiple serializers for each case:

  • Detail view (retrieve/update)
  • List view (list)
  • List view post (create)
  • GeoJSON versions?

Perhaps the view should then have more specific functions like get_serializer_for_update?

Edit: The biggest issue is really the excessive magic for generating nested serializers. Instead of detail/list/etc. serializers, this can be cleaned up simply by creating explicit, custom serializers whenever a nested serializer is needed. This will likely affect the external API so is a good candidate for 0.8. See #34.

@sheppard sheppard changed the title rest: cleanup ModelSerializer.get_default_fields rest: clean up ModelSerializer.get_default_fields Mar 19, 2014
@sheppard
Copy link
Member Author

This should probably be fixed in conjunction with #11

@sheppard sheppard added this to the 0.7 milestone Aug 13, 2014
@sheppard sheppard modified the milestones: 0.7, 0.8 Oct 31, 2014
@sheppard
Copy link
Member Author

Also see #32 which will likely involve similar changes.

sheppard added a commit that referenced this issue Mar 20, 2015
 - clean up ModelSerializer (fixes #22)
 - use field_id when saving foreign keys (fixes #11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant