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])