Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#573 closed enhancement (fixed)

[patch] add plus sign to ManyToMany fields in admin

Reported by: hp@… Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


This patch adds the "add-another" button to ManyToMany fields as well as ManyToOne.

Makes life a tad easier :)

Index: django/views/admin/
--- django/views/admin/  (revision 712)
+++ django/views/admin/  (working copy)
@@ -752,7 +752,7 @@
     # fields with relationships to editable objects get an "add another" link,
     # but only if the field doesn't have raw_admin ('cause in that case they get
     # the "add" button in the popup)
-    elif field.rel and isinstance(field.rel, meta.ManyToOne) and
+    elif field.rel and isinstance(field.rel, meta.ManyToOne) or isinstance(field.rel, meta.ManyToMany) and
         t.append('{%% if perms.%s.%s %%}' % (,
         t.append(' <a href="../../../%s/%s/add/" class="add-another" id="add_%s" onclick="return showAddAnotherPopup(this);">' % \
                     (,, field_id))

Attachments (1)

add_+_to_ManyToMany.diff (949 bytes) - added by anonymous 14 years ago.

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by anonymous

Attachment: add_+_to_ManyToMany.diff added

comment:1 Changed 14 years ago by Adrian Holovaty

Status: newassigned

comment:2 Changed 14 years ago by Adrian Holovaty

Resolution: fixed
Status: assignedclosed

(In [714]) Fixed #573 -- Added 'Add another' link to many-to-many fields in admin. Thanks, hp@…

comment:3 Changed 13 years ago by (none)

milestone: Version 1.0

Milestone Version 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top