admin.py 1.53 KB
#-*- 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)