ec6d715793aef308f5be853d329cd4078e59e554
[prawokultury.git] / questions / admin.py
1 from django.contrib import admin
2 from .models import Question, Tag
3
4 class QuestionAdmin(admin.ModelAdmin):
5     model = Question
6     list_filter = ('approved', 'answered', 'published')
7     list_display = ('question', 'email', 'created_at', 'approved', 'answered', 'published')
8     date_hierarchy = 'created_at'
9     search_fields = ('question', 'edited_question', 'answer', 'email')
10     fields = (
11         ('email', 'created_at', 'changed_at'),
12         'question',
13         'approved',
14         'edited_question',
15         'answer',
16         'tags',
17         ('answered', 'answered_at'),
18         ('published', 'published_at'),
19         
20     )
21     readonly_fields = ['created_at', 'answered_at', 'published_at', 'changed_at']
22
23
24 admin.site.register(Question, QuestionAdmin)
25 admin.site.register(Tag)