Ticket #7469: relation_link.diff
File relation_link.diff, 1.8 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/views/main.py
140 140 self.related_url = mark_safe(u'../../../%s/%s/' 141 141 % (field.rel.to._meta.app_label, 142 142 field.rel.to._meta.object_name.lower())) 143 144 if field.rel and isinstance(field.rel, models.ManyToOneRel): 145 self.fk_id = self.original.__dict__[self.field.attname] 143 146 144 147 def original_value(self): 145 148 if self.original: -
django/contrib/admin/templates/widget/foreign.html
8 8 {% endif %} 9 9 {% else %} 10 10 {% if bound_field.needs_add_label %} 11 <a href="{{ bound_field.related_url }}add/" class="add-another" id="add_{{ bound_field.element_id }}" onclick="return showAddAnotherPopup(this);"> <img src="{% admin_media_prefix %}img/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a> 11 <a href="{{ bound_field.related_url }}add/" class="add-another" id="add_{{ bound_field.element_id }}" onclick="return showAddAnotherPopup(this);"> <img src="{% admin_media_prefix %}img/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a> {%if bound_field.fk_id %}<a href="{{ bound_field.related_url }}{{ bound_field.fk_id }}/" title="Go to selected model"><img src="{% admin_media_prefix %}img/admin/selector-addall.gif" width="16" height="16" alt="Go to selected model"/></a>{% endif %} 12 12 {% endif %}{% endif %} 13 13 {% if change %} 14 14 {% if bound_field.field.primary_key %}