added markupwiki admin
This commit is contained in:
parent
aea197d8c3
commit
e81559ace4
12
markupwiki/admin.py
Normal file
12
markupwiki/admin.py
Normal 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)
|
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user