Ticket #7469: relation_link_na.diff

File relation_link_na.diff, 912 bytes (added by Reto Aebersold, 16 years ago)

Newforms admin relation patch

  • django/contrib/admin/widgets.py

     
    194194            output.append(u'<a href="%sadd/" class="add-another" id="add_id_%s" onclick="return showAddAnotherPopup(this);"> ' % \
    195195                (related_url, name))
    196196            output.append(u'<img src="%simg/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a>' % settings.ADMIN_MEDIA_PREFIX)
     197            if value != None:
     198                output.append(u'<a href="%s%s" title="Go to selected model"><img src="%simg/admin/selector-addall.gif" width="16" height="16" alt="Go to selected model"/></a>' % (related_url, value, settings.ADMIN_MEDIA_PREFIX))
    197199        return mark_safe(u''.join(output))
    198200
    199201    def build_attrs(self, extra_attrs=None, **kwargs):
Back to Top