admin.py
1.03 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
40
from django.contrib import admin
from models import Domain, Entry, Expression, Meaning, Segment, Source, MeaningStatus
class DomainAdmin(admin.ModelAdmin):
search_fields = ['name', ]
class EntryAdmin(admin.ModelAdmin):
search_fields = ['name', ]
exclude = ('meanings',)
class ExpressionAdmin(admin.ModelAdmin):
search_fields = ['text', ]
exclude = ('meaning',)
list_filter = ('DDG_responses', 'DDG_entry_responses', 'link__source',)
class MeaningAdmin(admin.ModelAdmin):
search_fields = [
'comment',
'expressions__text'
]
list_filter = ('expressions__DDG_entry_responses', 'expressions__link__source', 'status',)
class SegmentAdmin(admin.ModelAdmin):
search_fields = ['orth', ]
list_filter = ('has_nps',)
admin.site.register(Domain, DomainAdmin)
admin.site.register(Entry, EntryAdmin)
admin.site.register(Expression, ExpressionAdmin)
admin.site.register(Meaning, MeaningAdmin)
admin.site.register(MeaningStatus)
admin.site.register(Segment, SegmentAdmin)
admin.site.register(Source)