Blame view

accounts/admin.py 1.52 KB
Bartłomiej Nitoń authored
1
2
3
4
5
6
7
8
9
#-*- 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
Bartłomiej Nitoń authored
10
11
class RealizedLemmaAdmin(admin.ModelAdmin):
    exclude = ('lemma',) 
Bartłomiej Nitoń authored
12
    list_filter    = ('status', 'paid', 'lemma__vocabulary', 'bonus', 'counted',)
Bartłomiej Nitoń authored
13
    readonly_fields = ('date',)
Bartłomiej Nitoń authored
14
    search_fields  = ('lemma__entry',)
Bartłomiej Nitoń authored
15
16
17

class RealizedPhraseologyAdmin(admin.ModelAdmin):
    exclude = ('lemma',)
Bartłomiej Nitoń authored
18
    list_filter    = ('status', 'paid', 'lemma__vocabulary', 'bonus', 'counted',)
Bartłomiej Nitoń authored
19
20
    readonly_fields = ('date',)
    search_fields  = ('lemma__entry',)
Bartłomiej Nitoń authored
21
Bartłomiej Nitoń authored
22
23
class RealizedSemanticsAdmin(admin.ModelAdmin):
    exclude = ('entry',)  
Bartłomiej Nitoń authored
24
    list_filter    = ('status', 'bonus',)
Bartłomiej Nitoń authored
25
26
27
28
29
    search_fields  = ('entry__name',)

class UserStatsAdmin(admin.ModelAdmin):    
    exclude = ('lemma_real_history', 'phraseology_real_history', 
               'bind_phraseology_frames_history')
Bartłomiej Nitoń authored
30
31

admin.site.register(AnonymousUserProfile)   
Bartłomiej Nitoń authored
32
33
34
35
36
37
38
39
40
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)