Re: [Django] #8472: Add "Recent Actions" panel to app_index template

4 views
Skip to first unread message

Django

unread,
Jan 26, 2015, 12:54:06 PM1/26/15
to django-...@googlegroups.com
#8472: Add "Recent Actions" panel to app_index template
-------------------------------+------------------------------------
Reporter: juliae | Owner: burzak
Type: New feature | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+------------------------------------
Changes (by collinanderson):

* cc: cmawebsite@… (added)


Comment:

If it helps, I personally register the LogEntry model in the admin:

{{{
class LogEntryAdmin(admin.ModelAdmin):
list_display = ['action_time', 'obj', 'content_type', 'user',
'action', 'change_message']
list_filter = ['content_type']
readonly_fields = ['user', 'content_type', 'object_id', 'object_repr',
'action_flag', 'change_message']

def obj(self, obj):
return '<a href="%s">%s</a>' %
(obj.get_edited_object().get_absolute_url(),
conditional_escape(obj.object_repr))
obj.allow_tags = True
obj.admin_sort_field = 'object_repr'

def action(self, obj):
return (u'%s' % obj).split()[0]
obj.admin_sort_field = 'action_flag'
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/8472#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages