Linked articles and categories into site admin.
parent
558757318f
commit
8ff2bda49e
|
|
@ -1 +1,22 @@
|
||||||
# Register your models here.
|
import tagulous.admin
|
||||||
|
from django.contrib import admin
|
||||||
|
from markdownx.admin import MarkdownxModelAdmin
|
||||||
|
|
||||||
|
from .models import Article, Category
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(Category)
|
||||||
|
class CategoryAdmin(admin.ModelAdmin):
|
||||||
|
list_display = ['title', 'slug']
|
||||||
|
prepopulated_fields = {'slug': ('title',)}
|
||||||
|
|
||||||
|
|
||||||
|
class ArticleAdmin(MarkdownxModelAdmin):
|
||||||
|
list_display = ['title', 'subtitle', 'category', 'tags', 'created', 'updated', 'is_published', 'is_featured']
|
||||||
|
list_filter = ['is_published', 'is_featured', 'category', 'tags']
|
||||||
|
ordering = ['is_published', '-created']
|
||||||
|
prepopulated_fields = {'slug': ('title',)}
|
||||||
|
list_display_links = ['title', 'subtitle']
|
||||||
|
|
||||||
|
|
||||||
|
tagulous.admin.register(Article, ArticleAdmin)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue