I created a special admin class to display Admin comments in my Django application. I would like the elements in the "Object ID" section to link to the edit page of objects of the corresponding objects. How can i achieve this?
My admin comments:
class MyCommentsAdmin(admin.ModelAdmin): fieldsets = ( (_('Content'), {'fields': ('user', 'user_name', 'user_email', 'user_url', 'comment')} ), (_('Metadata'), {'fields': ('submit_date', 'ip_address', 'is_public', 'is_removed')} ), ) list_display = ('id', 'name', 'comment', 'content_type', 'object_pk', 'ip_address', 'submit_date', 'is_public', 'is_removed') list_filter = ('submit_date', 'site', 'is_public', 'is_removed') date_hierarchy = 'submit_date' list_display_links = ('id','comment',) ordering = ('-submit_date',) raw_id_fields = ('user',) search_fields = ('comment', 'user__username', 'user_name', 'user_email', 'ip_address') admin.site.unregister(Comment) admin.site.register(Comment, MyCommentsAdmin)
Thanks!!
rabbid
source share