Django

Code

Changeset 714

Show
Ignore:
Timestamp:
09/28/05 22:19:14 (3 years ago)
Author:
adrian
Message:

Fixed #573 -- Added 'Add another' link to many-to-many fields in admin. Thanks, hp@syntomax.com

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/views/admin/main.py

    r693 r714  
    753753    # but only if the field doesn't have raw_admin ('cause in that case they get 
    754754    # the "add" button in the popup) 
    755     elif field.rel and isinstance(field.rel, meta.ManyToOne) and field.rel.to.admin: 
     755    elif field.rel and (isinstance(field.rel, meta.ManyToOne) or isinstance(field.rel, meta.ManyToMany)) and field.rel.to.admin: 
    756756        t.append('{%% if perms.%s.%s %%}' % (field.rel.to.app_label, field.rel.to.get_add_permission())) 
    757757        t.append(' <a href="../../../%s/%s/add/" class="add-another" id="add_%s" onclick="return showAddAnotherPopup(this);">' % \