Code

Ticket #8917: comments-ordering.diff

File comments-ordering.diff, 1.3 KB (added by wilson, 6 years ago)

Patch to reverse ordering of comments and add submit_date to admin list_display

Line 
1Index: /Users/wilson/Development/django/trunk/django/contrib/comments/admin.py
2===================================================================
3--- /Users/wilson/Development/django/trunk/django/contrib/comments/admin.py     (revision 8975)
4+++ /Users/wilson/Development/django/trunk/django/contrib/comments/admin.py     (working copy)
5@@ -16,7 +16,7 @@
6         ),
7      )
8 
9-    list_display = ('name', 'content_type', 'object_pk', 'ip_address', 'is_public', 'is_removed')
10+    list_display = ('name', 'content_type', 'object_pk', 'ip_address', 'submit_date', 'is_public', 'is_removed')
11     list_filter = ('submit_date', 'site', 'is_public', 'is_removed')
12     date_hierarchy = 'submit_date'
13     search_fields = ('comment', 'user__username', 'user_name', 'user_email', 'user_url', 'ip_address')
14Index: /Users/wilson/Development/django/trunk/django/contrib/comments/models.py
15===================================================================
16--- /Users/wilson/Development/django/trunk/django/contrib/comments/models.py    (revision 8975)
17+++ /Users/wilson/Development/django/trunk/django/contrib/comments/models.py    (working copy)
18@@ -69,7 +69,7 @@
19 
20     class Meta:
21         db_table = "django_comments"
22-        ordering = ('submit_date',)
23+        ordering = ('-submit_date',)
24         permissions = [("can_moderate", "Can moderate comments")]
25 
26     def __unicode__(self):