getting file size for all dict files to be downloaded. coming to be 400mb or so.
[worddb.git] / words / admin.py
blob26193d3aa70adcb9a5631a676f6edfb0d0ba6682
1 # imports # {{{
2 from django.contrib import admin
4 from worddb.words.models import Word, Meaning, Pronunciation, ChangeSheet
5 from worddb.words.models import Etymology, Short
6 # }}}
8 # WordAdmin # {{{
9 # Inlines # {{{
10 class ShortInline(admin.TabularInline):
11 model = Short
12 extra = 1
14 class EtymologyInline(admin.TabularInline):
15 model = Etymology
16 extra = 1
18 class MeaningInline(admin.TabularInline):
19 model = Meaning
20 extra = 1
21 # }}}
22 class WordAdmin(admin.ModelAdmin):
23 model = Word
24 raw_id_fields = (
25 'synonyms', 'thesaurus', 'antonyms', 'translations',
26 'rhymes', 'relateds',
28 fieldsets = [
29 (None, { 'fields': ['word', 'language', 'forms'] }),
31 'Deleted?',
33 'fields': ['not_a_word', 'not_a_word_marked_on'],
34 'classes': ['collapse wid'],
38 'Relations',
40 'fields': [
41 'synonyms', 'thesaurus', 'antonyms',
42 'translations', 'rhymes', 'relateds',
44 'classes': ['collapse'],
48 inlines = [ShortInline, MeaningInline, EtymologyInline]
49 admin.site.register(Word, WordAdmin)
50 # }}}
51 # ChangeSheetAdmin # {{{
52 class ChangeSheetAdmin(admin.ModelAdmin):
53 model = ChangeSheet
54 raw_id_fields = ( 'word', 'user' )
55 admin.site.register(ChangeSheet, ChangeSheetAdmin)
56 # }}}
57 # EtymologyAdmin # {{{
58 class EtymologyAdmin(admin.ModelAdmin):
59 model = Etymology
60 raw_id_fields = ( 'word', )
61 admin.site.register(Etymology, EtymologyAdmin)
62 # }}}
63 # MeaningAdmin # {{{
64 class MeaningAdmin(admin.ModelAdmin):
65 model = Meaning
66 raw_id_fields = ( 'word', )
67 fieldsets = [
68 (None, { 'fields': ['word', 'meaning', 'usage', 'language', 'pol'] }),
70 'Deleted?',
72 'fields': ['is_deleted', 'deleted_on'],
73 'classes': ['collapse wid'],
77 admin.site.register(Meaning, MeaningAdmin)
78 # }}}
79 # PronunciationAdmin # {{{
80 class PronunciationAdmin(admin.ModelAdmin):
81 model = Pronunciation
82 fieldsets = [
83 (None, { 'fields': ['spelling', 'pronunciation_key',] }),
85 'Deleted?',
87 'fields': ['is_deleted', 'deleted_on'],
88 'classes': ['collapse wid'],
92 admin.site.register(Pronunciation, PronunciationAdmin)
93 # }}}
94 # PronunciationAdmin # {{{
95 class ShortAdmin(admin.ModelAdmin):
96 model = Short
97 raw_id_fields = ( 'word', )
98 admin.site.register(Short, ShortAdmin)
99 # }}}