#15661: LogEntry objects have no unicode method
------------------------------------+---------------------------
 Reporter:  Keryn Knight <keryn@…>  |         Owner:  nobody
   Status:  new                     |     Milestone:
Component:  django.contrib.admin    |       Version:  SVN
 Keywords:  logentry unicode        |  Triage Stage:  Unreviewed
Has patch:  1                       |
------------------------------------+---------------------------
 This only, as far as I can tell, affects the admin view for deleting
 objects. When get_deleted_objects is called on an object (eg: an
 auth.models.User instance) it can find the associated log entries, and
 display them as part of the list of objects to be culled; as it stands at
 the moment, when the template displays the data, it just says {{{ LogEntry
 object }}} or some such.

 I attach a simple patch that attempts to resolve that by providing a
 unicode representation of the logentry type, based on whether its an
 addition, change or deletion. The wording and string formatting takes its
 cues from the construct_change_message method on ModelAdmin.

 As far as I can foresee, having a default representation of some sort
 would not provide any obstacles, as any usage of log entries currently in
 use will either be assembling the data itself (as the {{{ get_admin_log
 }}} templatetag does), or using a proxy object to do it, which would have
 to provide its own unicode (which would take precedence).

 I'm not sure there's a legitimate case for a LogEntry ''not'' having an
 object_repr or change_message (both of which are utilised in the patch),
 but if there is, I've not handled it at current.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15661>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
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.

Reply via email to