Changeset 5694
- Timestamp:
- 07/14/07 08:14:28 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/admin/templatetags/admin_list.py
r5609 r5694 191 191 first = False 192 192 url = cl.url_for_result(result) 193 result_id = smart_unicode(getattr(result, pk)) # conversion to string is needed in case of 23L (long ints) 193 # Convert the pk to something that can be used in Javascript. 194 # Problem cases are long ints (23L) and non-ASCII strings. 195 result_id = repr(force_unicode(getattr(result, pk)))[1:] 194 196 yield (u'<%s%s><a href="%s"%s>%s</a></%s>' % \ 195 (table_tag, row_class, url, (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, % r); return false;"' % result_id or ''), result_repr, table_tag))197 (table_tag, row_class, url, (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %s); return false;"' % result_id or ''), result_repr, table_tag)) 196 198 else: 197 199 yield (u'<td%s>%s</td>' % (row_class, result_repr))
