admin.py
1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#-*- coding:utf-8 -*-
from django.contrib import admin
from django.contrib.sessions.models import Session
from models import AnonymousUserProfile, RealizedLemma, GroupSettings, \
RealizedPhraseology, RealizedPhraseologyBinding, \
RealizedSemantics, UserSettings, UserStats
class RealizedLemmaAdmin(admin.ModelAdmin):
exclude = ('lemma',)
list_filter = ('status', 'paid', 'lemma__vocabulary', 'bonus', 'counted',)
readonly_fields = ('date',)
search_fields = ('lemma__entry',)
class RealizedPhraseologyAdmin(admin.ModelAdmin):
exclude = ('lemma',)
list_filter = ('status', 'paid', 'lemma__vocabulary', 'bonus', 'counted',)
readonly_fields = ('date',)
search_fields = ('lemma__entry',)
class RealizedSemanticsAdmin(admin.ModelAdmin):
exclude = ('entry',)
list_filter = ('status', 'bonus',)
search_fields = ('entry__name',)
class UserStatsAdmin(admin.ModelAdmin):
exclude = ('lemma_real_history', 'phraseology_real_history',
'bind_phraseology_frames_history', 'semantics_real_history')
admin.site.register(AnonymousUserProfile)
admin.site.register(UserSettings)
admin.site.register(UserStats, UserStatsAdmin)
admin.site.register(RealizedLemma, RealizedLemmaAdmin)
admin.site.register(RealizedPhraseology, RealizedPhraseologyAdmin)
admin.site.register(RealizedSemantics, RealizedSemanticsAdmin)
admin.site.register(GroupSettings)
admin.site.register(RealizedPhraseologyBinding)
admin.site.register(Session)