added markupwiki admin

This commit is contained in:
James Turk 2010-04-01 14:30:33 -04:00
parent aea197d8c3
commit e81559ace4
2 changed files with 13 additions and 1 deletions

12
markupwiki/admin.py Normal file
View File

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

View File

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