Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

The second part of fixing "related inherited models" display. Handle …

…raw_id values for child models in the admin. Fixed #9461.

I couldn't think of a way to test this automatically and robustly, however,
manual testing with the ticket example shows failure before and success
afterwards and the fix make sense logically.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9602 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 662e12b45ce1cafa3806d8e8dd45638996e91bd7 1 parent d662ef5
Malcolm Tredinnick authored December 08, 2008
3  django/contrib/admin/templatetags/admin_list.py
@@ -222,7 +222,8 @@ def items_for_result(cl, result):
222 222
                 attr = str(cl.to_field)
223 223
             else:
224 224
                 attr = pk
225  
-            result_id = repr(force_unicode(getattr(result, attr)))[1:]
  225
+            value = result.serializable_value(attr)
  226
+            result_id = repr(force_unicode(value))[1:]
226 227
             yield mark_safe(u'<%s%s><a href="%s"%s>%s</a></%s>' % \
227 228
                 (table_tag, row_class, url, (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %s); return false;"' % result_id or ''), conditional_escape(result_repr), table_tag))
228 229
         else:

0 notes on commit 662e12b

Please sign in to comment.
Something went wrong with that request. Please try again.