diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-11-29 05:22:51 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-11-29 05:22:51 +0000 |
| commit | 1ce5ef6166d07f3858308eea44a9821c12b9cc66 (patch) | |
| tree | d95f77811d95eda3315c657aff051d3554bf0faf | |
| parent | de7a336486f83dd9c01b8c2fd3feb014da7f5a49 (diff) | |
Fixed error in raw_id_admin on ManyToManyFields caused by [1434] -- they weren't working.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1485 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/formfields.py | 4 | ||||
| -rw-r--r-- | django/core/meta/__init__.py | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/django/core/formfields.py b/django/core/formfields.py index 0cfe6b2890..1ae4873fa2 100644 --- a/django/core/formfields.py +++ b/django/core/formfields.py @@ -887,8 +887,8 @@ class CommaSeparatedIntegerField(TextField): class RawIdAdminField(CommaSeparatedIntegerField): def html2python(data): - return data.split(','); - html2python = classmethod(html2python) + return data.split(',') + html2python = staticmethod(html2python) class XMLLargeTextField(LargeTextField): """ diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index 76830d0c02..eb83545897 100644 --- a/django/core/meta/__init__.py +++ b/django/core/meta/__init__.py @@ -1702,7 +1702,11 @@ def manipulator_save(opts, klass, add, change, self, new_data): for f in opts.many_to_many: if self.follow.get(f.name, None): if not f.rel.edit_inline: - was_changed = getattr(new_object, 'set_%s' % f.name)(new_data.getlist(f.name)) + if f.rel.raw_id_admin: + new_vals = new_data.get(f.name, ()) + else: + new_vals = new_data.getlist(f.name) + was_changed = getattr(new_object, 'set_%s' % f.name)(new_vals) if change and was_changed: self.fields_changed.append(f.verbose_name) |
