Author: mtredinnick Date: 2008-12-08 02:16:26 -0600 (Mon, 08 Dec 2008) New Revision: 9602
Modified: django/trunk/django/contrib/admin/templatetags/admin_list.py Log: 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. Modified: django/trunk/django/contrib/admin/templatetags/admin_list.py =================================================================== --- django/trunk/django/contrib/admin/templatetags/admin_list.py 2008-12-08 08:15:37 UTC (rev 9601) +++ django/trunk/django/contrib/admin/templatetags/admin_list.py 2008-12-08 08:16:26 UTC (rev 9602) @@ -222,7 +222,8 @@ attr = str(cl.to_field) else: attr = pk - result_id = repr(force_unicode(getattr(result, attr)))[1:] + value = result.serializable_value(attr) + result_id = repr(force_unicode(value))[1:] yield mark_safe(u'<%s%s><a href="%s"%s>%s</a></%s>' % \ (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)) else: --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---