ae6ac1d64c5493cd6fc5f67ea34dc677b4087057
[prawokultury.git] / questions / admin.py
1 from django.contrib import admin
2 from .models import Question
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     fields = (
10         ('email', 'created_at', 'changed_at'),
11         'question',
12         'approved',
13         'edited_question',
14         'answer',
15         ('answered', 'answered_at'),
16         ('published', 'published_at'),
17         
18     )
19     readonly_fields = ['created_at', 'answered_at', 'published_at', 'changed_at']
20
21
22 admin.site.register(Question, QuestionAdmin)