aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/models.py
diff options
context:
space:
mode:
authorMatt d'Entremont2015-03-04 17:36:03 -0400
committerMatt d'Entremont2015-03-06 12:50:37 -0400
commitfb58ef043cc39d900bb8389855f07087cb0d7920 (patch)
tree79e80017c1f7535c7d9a592888ef6c0aa352e039 /rest_framework/models.py
parentf7917928c080aa0b055cbfc588f61ec01f16771c (diff)
downloaddjango-rest-framework-fb58ef043cc39d900bb8389855f07087cb0d7920.tar.bz2
Add support for serializing models with m2m related fields
- In both ManyRelatedField, provide an empty return when trying to access a relation field if the instance in question has no PK (so likely hasn't been inserted yet) - Add relevant tests - Without these changes, exceptions would be raised when trying to serialize the uncreated models as it is impossible to query relations without a PK - Add test to ensure RelatedField does not regress as currently supports being serialized with and unsaved model
Diffstat (limited to 'rest_framework/models.py')
0 files changed, 0 insertions, 0 deletions