First Commit
This commit is contained in:
commit
ce0758fbbb
496 changed files with 52062 additions and 0 deletions
33
forum/admin.py
Executable file
33
forum/admin.py
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
from django.contrib import admin
|
||||
from .models import Category, Forum, Topic, Post
|
||||
|
||||
class CategoryAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'description', 'created', 'updated')
|
||||
list_filter = ('created', 'updated')
|
||||
search_fields = ('name', 'description')
|
||||
ordering = ('-created',)
|
||||
fields = ('name', 'description')
|
||||
|
||||
class ForumAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'author', 'category', 'created', 'updated')
|
||||
list_filter = ('category', 'author', 'created', 'updated')
|
||||
search_fields = ('name', 'description')
|
||||
ordering = ('-created',)
|
||||
fields = ('category', 'author', 'name', 'description')
|
||||
|
||||
class TopicAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'author', 'created', 'updated')
|
||||
list_filter = ('forum', 'author', 'created', 'updated', 'state')
|
||||
search_fields = ('title',)
|
||||
ordering = ('-created',)
|
||||
fields = ('forum', 'author', 'title', 'state')
|
||||
|
||||
class PostAdmin(admin.ModelAdmin):
|
||||
list_display = ('type', 'topic', 'author', 'created', 'updated')
|
||||
list_filter = ('topic', 'author', 'created', 'updated', 'type')
|
||||
fields = ('topic', 'author', 'content', 'type')
|
||||
|
||||
admin.site.register(Category, CategoryAdmin)
|
||||
admin.site.register(Forum, ForumAdmin)
|
||||
admin.site.register(Topic, TopicAdmin)
|
||||
admin.site.register(Post, PostAdmin)
|
||||
Loading…
Add table
Add a link
Reference in a new issue