2 from django
.contrib
import admin
4 from worddb
.words
.models
import Word
, Meaning
, Pronunciation
, ChangeSheet
5 from worddb
.words
.models
import Etymology
, Short
10 class ShortInline(admin
.TabularInline
):
14 class EtymologyInline(admin
.TabularInline
):
18 class MeaningInline(admin
.TabularInline
):
22 class WordAdmin(admin
.ModelAdmin
):
25 'synonyms', 'thesaurus', 'antonyms', 'translations',
29 (None, { 'fields': ['word', 'language', 'forms'] }),
33 'fields': ['not_a_word', 'not_a_word_marked_on'],
34 'classes': ['collapse wid'],
41 'synonyms', 'thesaurus', 'antonyms',
42 'translations', 'rhymes', 'relateds',
44 'classes': ['collapse'],
48 inlines
= [ShortInline
, MeaningInline
, EtymologyInline
]
49 admin
.site
.register(Word
, WordAdmin
)
51 # ChangeSheetAdmin # {{{
52 class ChangeSheetAdmin(admin
.ModelAdmin
):
54 raw_id_fields
= ( 'word', 'user' )
55 admin
.site
.register(ChangeSheet
, ChangeSheetAdmin
)
57 # EtymologyAdmin # {{{
58 class EtymologyAdmin(admin
.ModelAdmin
):
60 raw_id_fields
= ( 'word', )
61 admin
.site
.register(Etymology
, EtymologyAdmin
)
64 class MeaningAdmin(admin
.ModelAdmin
):
66 raw_id_fields
= ( 'word', )
68 (None, { 'fields': ['word', 'meaning', 'usage', 'language', 'pol'] }),
72 'fields': ['is_deleted', 'deleted_on'],
73 'classes': ['collapse wid'],
77 admin
.site
.register(Meaning
, MeaningAdmin
)
79 # PronunciationAdmin # {{{
80 class PronunciationAdmin(admin
.ModelAdmin
):
83 (None, { 'fields': ['spelling', 'pronunciation_key',] }),
87 'fields': ['is_deleted', 'deleted_on'],
88 'classes': ['collapse wid'],
92 admin
.site
.register(Pronunciation
, PronunciationAdmin
)
94 # PronunciationAdmin # {{{
95 class ShortAdmin(admin
.ModelAdmin
):
97 raw_id_fields
= ( 'word', )
98 admin
.site
.register(Short
, ShortAdmin
)