summaryrefslogtreecommitdiff
path: root/news
diff options
context:
space:
mode:
Diffstat (limited to 'news')
-rw-r--r--news/admin.py4
-rw-r--r--news/models.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/news/admin.py b/news/admin.py
index 1fdd534c..1b7de1d8 100644
--- a/news/admin.py
+++ b/news/admin.py
@@ -3,8 +3,8 @@ from django.contrib import admin
from .models import News
class NewsAdmin(admin.ModelAdmin):
- list_display = ('title', 'author', 'postdate')
- list_filter = ('author', 'postdate')
+ list_display = ('title', 'author', 'postdate', 'last_modified')
+ list_filter = ('postdate', 'author')
search_fields = ('title', 'content')
admin.site.register(News, NewsAdmin)
diff --git a/news/models.py b/news/models.py
index f2b91b83..ea014492 100644
--- a/news/models.py
+++ b/news/models.py
@@ -4,7 +4,7 @@ from django.contrib.auth.models import User
class News(models.Model):
id = models.AutoField(primary_key=True)
author = models.ForeignKey(User, related_name='news_author')
- postdate = models.DateTimeField(auto_now_add=True, db_index=True)
+ postdate = models.DateTimeField("post date", auto_now_add=True, db_index=True)
last_modified = models.DateTimeField(editable=False,
auto_now=True, db_index=True)
title = models.CharField(max_length=255)
@@ -20,6 +20,6 @@ class News(models.Model):
db_table = 'news'
verbose_name_plural = 'news'
get_latest_by = 'postdate'
- ordering = ['-postdate', '-id']
+ ordering = ['-postdate']
# vim: set ts=4 sw=4 et: