diff options
| author | Matt d'Entremont | 2015-03-04 17:36:03 -0400 |
|---|---|---|
| committer | Matt d'Entremont | 2015-03-06 12:50:37 -0400 |
| commit | fb58ef043cc39d900bb8389855f07087cb0d7920 (patch) | |
| tree | 79e80017c1f7535c7d9a592888ef6c0aa352e039 /rest_framework/authtoken | |
| parent | f7917928c080aa0b055cbfc588f61ec01f16771c (diff) | |
| download | django-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/authtoken')
0 files changed, 0 insertions, 0 deletions
