admin.py 1.03 KB
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)