From e81559ace420d925cd1498fa28fcd9c43e472f30 Mon Sep 17 00:00:00 2001 From: James Turk Date: Thu, 1 Apr 2010 14:30:33 -0400 Subject: [PATCH] added markupwiki admin --- markupwiki/admin.py | 12 ++++++++++++ markupwiki/models.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 markupwiki/admin.py diff --git a/markupwiki/admin.py b/markupwiki/admin.py new file mode 100644 index 0000000..dfee73b --- /dev/null +++ b/markupwiki/admin.py @@ -0,0 +1,12 @@ +from django.contrib import admin +from markupwiki.models import Article, ArticleVersion + +class VersionInline(admin.TabularInline): + model = ArticleVersion + +class ArticleAdmin(admin.ModelAdmin): + list_display = ('title', 'status') + list_filter = ('status',) + inlines = [VersionInline] + +admin.site.register(Article, ArticleAdmin) diff --git a/markupwiki/models.py b/markupwiki/models.py index ee69d76..10e831c 100644 --- a/markupwiki/models.py +++ b/markupwiki/models.py @@ -68,7 +68,7 @@ class ArticleVersion(models.Model): get_latest_by = 'timestamp' def __unicode__(self): - return unicode(self.article) + return '%s rev #%s' % (self.article, self.number) def get_absolute_url(self): return reverse('article_version', args=[self.article.title, self.number])