diff options
| author | Craig Blaszczyk | 2011-07-08 18:14:52 +0100 |
|---|---|---|
| committer | Craig Blaszczyk | 2011-07-08 18:14:52 +0100 |
| commit | 91b9d0b2a3fa55ff163f64bc689a59ca01cff8bb (patch) | |
| tree | e95d4335c5b56e4bc44fdab3ecf71d8076bcb422 /djangorestframework/mixins.py | |
| parent | 344db0d733eed8d3be84222a549a651acd6f3ee8 (diff) | |
| download | django-rest-framework-91b9d0b2a3fa55ff163f64bc689a59ca01cff8bb.tar.bz2 | |
remove hardcoded model._meta.many_to_many[0]; update mixin tests to test with 0, 1, or multiple groups
Diffstat (limited to 'djangorestframework/mixins.py')
| -rw-r--r-- | djangorestframework/mixins.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/djangorestframework/mixins.py b/djangorestframework/mixins.py index 9f65625e..b1c0d815 100644 --- a/djangorestframework/mixins.py +++ b/djangorestframework/mixins.py @@ -524,8 +524,7 @@ class CreateModelMixin(object): for field in model._meta.many_to_many: if content.has_key(field.name): m2m_data[field.name] = ( - model._meta.many_to_many[0].m2m_reverse_field_name(), - content[field.name] + field.m2m_reverse_field_name(), content[field.name] ) del content[field.name] |
