1 from django.contrib import admin
2 from .models import Question, Tag, TagCategory
4 class QuestionAdmin(admin.ModelAdmin):
6 list_filter = ('approved', 'answered', 'published', 'answered_by')
7 list_display = ('question', 'email', 'created_at', 'approved', 'answered', 'published')
8 date_hierarchy = 'created_at'
9 search_fields = ('question', 'edited_question', 'answer', 'email')
11 ('email', 'created_at', 'changed_at'),
18 ('answered', 'answered_at'),
19 ('published', 'published_at'),
22 readonly_fields = ['created_at', 'answered_at', 'published_at', 'changed_at']
25 admin.site.register(Question, QuestionAdmin)
26 admin.site.register(Tag)
27 admin.site.register(TagCategory)