Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed error in raw_id_admin on ManyToManyFields caused by [1434] -- t…

…hey weren't working.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1485 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1ce5ef6166d07f3858308eea44a9821c12b9cc66 1 parent de7a336
Adrian Holovaty authored November 29, 2005
4  django/core/formfields.py
@@ -887,8 +887,8 @@ def isCommaSeparatedIntegerList(self, field_data, all_data):
887 887
 
888 888
 class RawIdAdminField(CommaSeparatedIntegerField):
889 889
     def html2python(data):
890  
-        return data.split(',');
891  
-    html2python = classmethod(html2python)
  890
+        return data.split(',')
  891
+    html2python = staticmethod(html2python)
892 892
 
893 893
 class XMLLargeTextField(LargeTextField):
894 894
     """
6  django/core/meta/__init__.py
@@ -1702,7 +1702,11 @@ def manipulator_save(opts, klass, add, change, self, new_data):
1702 1702
     for f in opts.many_to_many:
1703 1703
         if self.follow.get(f.name, None):
1704 1704
             if not f.rel.edit_inline:
1705  
-                was_changed = getattr(new_object, 'set_%s' % f.name)(new_data.getlist(f.name))
  1705
+                if f.rel.raw_id_admin:
  1706
+                    new_vals = new_data.get(f.name, ())
  1707
+                else:
  1708
+                    new_vals = new_data.getlist(f.name)
  1709
+                was_changed = getattr(new_object, 'set_%s' % f.name)(new_vals)
1706 1710
                 if change and was_changed:
1707 1711
                     self.fields_changed.append(f.verbose_name)
1708 1712
 

0 notes on commit 1ce5ef6

Please sign in to comment.
Something went wrong with that request. Please try again.