From 91b9d0b2a3fa55ff163f64bc689a59ca01cff8bb Mon Sep 17 00:00:00 2001 From: Craig Blaszczyk Date: Fri, 8 Jul 2011 18:14:52 +0100 Subject: remove hardcoded model._meta.many_to_many[0]; update mixin tests to test with 0, 1, or multiple groups --- djangorestframework/mixins.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'djangorestframework/mixins.py') 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] -- cgit v1.2.3