1 from django
.contrib
import admin
3 from worddb
.words
.models
import Word
, Meaning
, Pronunciation
, ChangeSheet
4 from worddb
.words
.models
import Etymology
, Short
8 class ShortInline(admin
.TabularInline
):
12 class EtymologyInline(admin
.TabularInline
):
16 class MeaningInline(admin
.TabularInline
):
20 class WordAdmin(admin
.ModelAdmin
):
23 'synonyms', 'thesaurus', 'antonyms', 'translations',
27 (None, { 'fields': ['word', 'language', 'forms'] }),
31 'fields': ['not_a_word', 'not_a_word_marked_on'],
32 'classes': ['collapse wid'],
39 'synonyms', 'thesaurus', 'antonyms',
40 'translations', 'rhymes', 'relateds',
42 'classes': ['collapse'],
46 inlines
= [ShortInline
, MeaningInline
, EtymologyInline
]
47 admin
.site
.register(Word
, WordAdmin
)
50 # ChangeSheetAdmin # {{{
51 class ChangeSheetAdmin(admin
.ModelAdmin
):
53 raw_id_fields
= ( 'word', 'user' )
54 admin
.site
.register(ChangeSheet
, ChangeSheetAdmin
)
57 # EtymologyAdmin # {{{
58 class EtymologyAdmin(admin
.ModelAdmin
):
60 raw_id_fields
= ( 'word', )
61 admin
.site
.register(Etymology
, EtymologyAdmin
)
65 class MeaningAdmin(admin
.ModelAdmin
):
67 raw_id_fields
= ( 'word', )
69 (None, { 'fields': ['word', 'meaning', 'usage', 'language', 'pol'] }),
73 'fields': ['is_deleted', 'deleted_on'],
74 'classes': ['collapse wid'],
78 admin
.site
.register(Meaning
, MeaningAdmin
)
81 # PronunciationAdmin # {{{
82 class PronunciationAdmin(admin
.ModelAdmin
):
85 (None, { 'fields': ['spelling', 'pronunciation_key',] }),
89 'fields': ['is_deleted', 'deleted_on'],
90 'classes': ['collapse wid'],
94 admin
.site
.register(Pronunciation
, PronunciationAdmin
)
97 # PronunciationAdmin # {{{
98 class ShortAdmin(admin
.ModelAdmin
):
100 raw_id_fields
= ( 'word', )
101 admin
.site
.register(Short
, ShortAdmin
)