From 6eaf154a2e81d21d02f3597dd0e3dad01db8d07c Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 8 Apr 2009 19:57:27 +0000 Subject: [PATCH] Fixed #9341: add another on `ManyToManyField`s with `raw_id_admins` now works correctly. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10452 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/media/js/admin/RelatedObjectLookups.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django/contrib/admin/media/js/admin/RelatedObjectLookups.js b/django/contrib/admin/media/js/admin/RelatedObjectLookups.js index d201f39092..1bc78f89b1 100644 --- a/django/contrib/admin/media/js/admin/RelatedObjectLookups.js +++ b/django/contrib/admin/media/js/admin/RelatedObjectLookups.js @@ -79,7 +79,11 @@ function dismissAddAnotherPopup(win, newId, newRepr) { elem.options[elem.options.length] = o; o.selected = true; } else if (elem.nodeName == 'INPUT') { - elem.value = newId; + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + newId; + } else { + elem.value = newId; + } } } else { var toId = name + "_to";