summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2006-09-26 12:53:15 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2006-09-26 12:53:15 +0000
commit0d19b2eaaefead036cc71564d90cffe5e3c45df7 (patch)
tree366c635ddf6cc6cc219db0bc2cd89c98a23c4869
parentae0bea8d50f0070a7c1c377fb239bcd6926fbf82 (diff)
Refs #2243 -- Fixed manipulator handling of raw_id_admin m2m edit_inline fields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/manipulators.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/models/manipulators.py b/django/db/models/manipulators.py
index d62b0e7e79..daca9d7105 100644
--- a/django/db/models/manipulators.py
+++ b/django/db/models/manipulators.py
@@ -215,6 +215,9 @@ class AutomaticManipulator(forms.Manipulator):
# Save many-to-many objects.
for f in related.opts.many_to_many:
if child_follow.get(f.name, None) and not f.rel.edit_inline:
+ new_value = rel_new_data[f.attname]
+ if f.rel.raw_id_admin:
+ new_value = new_value[0]
setattr(new_rel_obj, f.name, f.rel.to.objects.filter(pk__in=rel_new_data[f.attname]))
if self.change:
self.fields_changed.append('%s for %s "%s"' % (f.verbose_name, related.opts.verbose_name, new_rel_obj))