|
@ -123,7 +123,7 @@ class PrilohaReseniInline(admin.StackedInline): |
|
|
class ProblemInline(admin.TabularInline): |
|
|
class ProblemInline(admin.TabularInline): |
|
|
model = Problem |
|
|
model = Problem |
|
|
fk_name = 'cislo_zadani' |
|
|
fk_name = 'cislo_zadani' |
|
|
fields = ['kod', 'typ', 'nazev', 'body', 'opravovatel', 'stav'] |
|
|
fields = ['kod', 'nazev', 'autor', 'garant', 'opravovatele', 'stav'] |
|
|
formfield_overrides = { |
|
|
formfield_overrides = { |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
} |
|
|
} |
|
@ -159,7 +159,7 @@ class ReseniKProblemuInline(admin.TabularInline): |
|
|
class ReseniKResiteliInline(admin.TabularInline): |
|
|
class ReseniKResiteliInline(admin.TabularInline): |
|
|
model = Reseni |
|
|
model = Reseni |
|
|
fields = ['problem', 'forma', 'body', 'cislo_body', 'timestamp', 'poznamka'] |
|
|
fields = ['problem', 'forma', 'body', 'cislo_body', 'timestamp', 'poznamka'] |
|
|
readonly_fields = ['timestamp', 'problem'] |
|
|
readonly_fields = ['cas_doruceni', 'problem'] |
|
|
extra = 0 |
|
|
extra = 0 |
|
|
formfield_overrides = { |
|
|
formfield_overrides = { |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
@ -269,7 +269,7 @@ class CisloAdmin(VersionAdmin): |
|
|
'pdf' |
|
|
'pdf' |
|
|
] |
|
|
] |
|
|
}), |
|
|
}), |
|
|
(u'Data', {'fields': ['datum_vydani', 'datum_deadline', |
|
|
('Data', {'fields': ['datum_vydani', 'datum_deadline', |
|
|
'datum_deadline_soustredeni']}), |
|
|
'datum_deadline_soustredeni']}), |
|
|
] |
|
|
] |
|
|
list_display = [ |
|
|
list_display = [ |
|
@ -284,10 +284,10 @@ class CisloAdmin(VersionAdmin): |
|
|
list_filter = ['rocnik'] |
|
|
list_filter = ['rocnik'] |
|
|
view_on_site = Cislo.verejne_url |
|
|
view_on_site = Cislo.verejne_url |
|
|
actions = [ |
|
|
actions = [ |
|
|
make_set_action('verejne_db', True, u'Zveřejnit číslo'), |
|
|
make_set_action('verejne_db', True, 'Zveřejnit číslo'), |
|
|
make_set_action('verejne_db', False, u'Skrýt (zneveřejnit) číslo'), |
|
|
make_set_action('verejne_db', False, 'Skrýt (zneveřejnit) číslo'), |
|
|
make_set_action('verejna_vysledkovka', True, u'Zveřejnit výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', True, 'Zveřejnit výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', False, u'Skrýt (zneveřejnit) výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', False, 'Skrýt (zneveřejnit) výsledkovku'), |
|
|
] |
|
|
] |
|
|
inlines = [ProblemInline] |
|
|
inlines = [ProblemInline] |
|
|
|
|
|
|
|
@ -334,14 +334,14 @@ admin.site.register(Rocnik, RocnikAdmin) |
|
|
class ReseniAdmin(VersionAdmin): |
|
|
class ReseniAdmin(VersionAdmin): |
|
|
#form = autocomplete_light.modelform_factory(Reseni, autocomplete_fields=['problem', 'resitele'], fields=['problem', 'resitele']) |
|
|
#form = autocomplete_light.modelform_factory(Reseni, autocomplete_fields=['problem', 'resitele'], fields=['problem', 'resitele']) |
|
|
fieldsets = [ |
|
|
fieldsets = [ |
|
|
(None, {'fields': ['problem', 'resitele', 'forma', 'body', 'cislo_body', 'timestamp']}), |
|
|
(None, {'fields': ['problem__set', 'resitele__set', 'forma', 'cas_doruceni']}), |
|
|
(u'Poznámky', {'fields': ['poznamka']}), |
|
|
(u'Poznámky', {'fields': ['poznamka']}), |
|
|
] |
|
|
] |
|
|
readonly_fields = ['timestamp'] |
|
|
readonly_fields = ['cas_doruceni'] |
|
|
list_display = ['problem', 'resitele', 'forma', 'body', 'timestamp', 'cislo_body'] |
|
|
list_display = [ProblemInline, ResitelInline, 'forma', 'cas_doruceni'] |
|
|
list_filter = ['body', 'timestamp', 'forma'] |
|
|
list_filter = ['cas_doruceni', 'forma'] |
|
|
search_fields = [] |
|
|
search_fields = [] |
|
|
inlines = [PrilohaReseniInline] |
|
|
inlines = [PrilohaReseniInline,ProblemInline,ResitelInline] |
|
|
view_on_site = False |
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
def get_queryset(self, request): |
|
@ -456,7 +456,7 @@ class ProblemAdmin(VersionAdmin): |
|
|
form = ProblemAdminForm |
|
|
form = ProblemAdminForm |
|
|
fieldsets = [ |
|
|
fieldsets = [ |
|
|
(None, {'fields': ['nazev', 'typ', 'stav', 'autor', 'zamereni', 'body', 'timestamp', 'import_dakos_id']}), |
|
|
(None, {'fields': ['nazev', 'typ', 'stav', 'autor', 'zamereni', 'body', 'timestamp', 'import_dakos_id']}), |
|
|
(u'Vydání', {'fields': ['cislo_zadani', 'kod', 'cislo_reseni', 'opravovatel',]}), |
|
|
(u'Vydání', {'fields': ['kod', 'cislo_reseni', 'opravovatel',]}), |
|
|
(None, {'fields': ['text_zadani', 'text_reseni', 'text_org',]}), |
|
|
(None, {'fields': ['text_zadani', 'text_reseni', 'text_org',]}), |
|
|
] |
|
|
] |
|
|
list_select_related = True |
|
|
list_select_related = True |
|
@ -572,8 +572,8 @@ class SoustredeniAdminForm(forms.ModelForm): |
|
|
class SoustredeniAdmin(VersionAdmin): |
|
|
class SoustredeniAdmin(VersionAdmin): |
|
|
form = SoustredeniAdminForm |
|
|
form = SoustredeniAdminForm |
|
|
fieldsets = [ |
|
|
fieldsets = [ |
|
|
(None, {'fields': ['rocnik', 'misto', 'typ', 'verejne_db', 'exportovat', 'text']}), |
|
|
(None, {'fields': ['rocnik', 'misto', 'typ', 'verejne_db', 'exportovat', 'text']}), |
|
|
(u'Data', {'fields': ['datum_zacatku', 'datum_konce']}), |
|
|
('Data', {'fields': ['datum_zacatku', 'datum_konce']}), |
|
|
] |
|
|
] |
|
|
list_display = ['rocnik', 'misto', 'datum_zacatku', 'typ', 'exportovat', 'verejne'] |
|
|
list_display = ['rocnik', 'misto', 'datum_zacatku', 'typ', 'exportovat', 'verejne'] |
|
|
inlines = [Soustredeni_UcastniciInline, Soustredeni_OrganizatoriInline] |
|
|
inlines = [Soustredeni_UcastniciInline, Soustredeni_OrganizatoriInline] |
|
|