Merge branch 'python3' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into python3
This commit is contained in:
commit
9945d6232a
2 changed files with 18 additions and 18 deletions
|
@ -123,7 +123,7 @@ class PrilohaReseniInline(admin.StackedInline):
|
|||
class ProblemInline(admin.TabularInline):
|
||||
model = Problem
|
||||
fk_name = 'cislo_zadani'
|
||||
fields = ['kod', 'typ', 'nazev', 'body', 'opravovatel', 'stav']
|
||||
fields = ['kod', 'nazev', 'autor', 'garant', 'opravovatele', 'stav']
|
||||
formfield_overrides = {
|
||||
models.TextField: {'widget': forms.TextInput},
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ class ReseniKProblemuInline(admin.TabularInline):
|
|||
class ReseniKResiteliInline(admin.TabularInline):
|
||||
model = Reseni
|
||||
fields = ['problem', 'forma', 'body', 'cislo_body', 'timestamp', 'poznamka']
|
||||
readonly_fields = ['timestamp', 'problem']
|
||||
readonly_fields = ['cas_doruceni', 'problem']
|
||||
extra = 0
|
||||
formfield_overrides = {
|
||||
models.TextField: {'widget': forms.TextInput},
|
||||
|
@ -269,7 +269,7 @@ class CisloAdmin(VersionAdmin):
|
|||
'pdf'
|
||||
]
|
||||
}),
|
||||
(u'Data', {'fields': ['datum_vydani', 'datum_deadline',
|
||||
('Data', {'fields': ['datum_vydani', 'datum_deadline',
|
||||
'datum_deadline_soustredeni']}),
|
||||
]
|
||||
list_display = [
|
||||
|
@ -284,10 +284,10 @@ class CisloAdmin(VersionAdmin):
|
|||
list_filter = ['rocnik']
|
||||
view_on_site = Cislo.verejne_url
|
||||
actions = [
|
||||
make_set_action('verejne_db', True, u'Zveřejnit číslo'),
|
||||
make_set_action('verejne_db', False, u'Skrýt (zneveřejnit) číslo'),
|
||||
make_set_action('verejna_vysledkovka', True, u'Zveřejnit výsledkovku'),
|
||||
make_set_action('verejna_vysledkovka', False, u'Skrýt (zneveřejnit) výsledkovku'),
|
||||
make_set_action('verejne_db', True, 'Zveřejnit číslo'),
|
||||
make_set_action('verejne_db', False, 'Skrýt (zneveřejnit) číslo'),
|
||||
make_set_action('verejna_vysledkovka', True, 'Zveřejnit výsledkovku'),
|
||||
make_set_action('verejna_vysledkovka', False, 'Skrýt (zneveřejnit) výsledkovku'),
|
||||
]
|
||||
inlines = [ProblemInline]
|
||||
|
||||
|
@ -334,14 +334,14 @@ admin.site.register(Rocnik, RocnikAdmin)
|
|||
class ReseniAdmin(VersionAdmin):
|
||||
#form = autocomplete_light.modelform_factory(Reseni, autocomplete_fields=['problem', 'resitele'], fields=['problem', 'resitele'])
|
||||
fieldsets = [
|
||||
(None, {'fields': ['problem', 'resitele', 'forma', 'body', 'cislo_body', 'timestamp']}),
|
||||
(None, {'fields': ['problem__set', 'resitele__set', 'forma', 'cas_doruceni']}),
|
||||
(u'Poznámky', {'fields': ['poznamka']}),
|
||||
]
|
||||
readonly_fields = ['timestamp']
|
||||
list_display = ['problem', 'resitele', 'forma', 'body', 'timestamp', 'cislo_body']
|
||||
list_filter = ['body', 'timestamp', 'forma']
|
||||
readonly_fields = ['cas_doruceni']
|
||||
list_display = [ProblemInline, ResitelInline, 'forma', 'cas_doruceni']
|
||||
list_filter = ['cas_doruceni', 'forma']
|
||||
search_fields = []
|
||||
inlines = [PrilohaReseniInline]
|
||||
inlines = [PrilohaReseniInline,ProblemInline,ResitelInline]
|
||||
view_on_site = False
|
||||
|
||||
def get_queryset(self, request):
|
||||
|
@ -456,7 +456,7 @@ class ProblemAdmin(VersionAdmin):
|
|||
form = ProblemAdminForm
|
||||
fieldsets = [
|
||||
(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',]}),
|
||||
]
|
||||
list_select_related = True
|
||||
|
@ -572,8 +572,8 @@ class SoustredeniAdminForm(forms.ModelForm):
|
|||
class SoustredeniAdmin(VersionAdmin):
|
||||
form = SoustredeniAdminForm
|
||||
fieldsets = [
|
||||
(None, {'fields': ['rocnik', 'misto', 'typ', 'verejne_db', 'exportovat', 'text']}),
|
||||
(u'Data', {'fields': ['datum_zacatku', 'datum_konce']}),
|
||||
(None, {'fields': ['rocnik', 'misto', 'typ', 'verejne_db', 'exportovat', 'text']}),
|
||||
('Data', {'fields': ['datum_zacatku', 'datum_konce']}),
|
||||
]
|
||||
list_display = ['rocnik', 'misto', 'datum_zacatku', 'typ', 'exportovat', 'verejne']
|
||||
inlines = [Soustredeni_UcastniciInline, Soustredeni_OrganizatoriInline]
|
||||
|
|
|
@ -603,7 +603,7 @@ class Problem(SeminarModelBase):
|
|||
related_name='garant_problemu_%(class)s', null=True, blank=True)
|
||||
|
||||
opravovatele = models.ManyToManyField(Organizator, verbose_name='opravovatelé',
|
||||
null=True, blank=True, related_name='opravovatele_%(class)s')
|
||||
blank=True, related_name='opravovatele_%(class)s')
|
||||
|
||||
kod = models.CharField('lokální kód', max_length=32, blank=True, default='',
|
||||
help_text='Číslo/kód úlohy v čísle nebo kód tématu/článku/seriálu v ročníku')
|
||||
|
@ -708,9 +708,9 @@ class Uloha(Problem):
|
|||
verbose_name_plural = 'Úlohy'
|
||||
|
||||
|
||||
zadani = models.ForeignKey(Text, verbose_name='veřejné zadání', blank=True, null=True)
|
||||
zadani = models.ForeignKey(Text, verbose_name='veřejné zadání', related_name="uloha_zadani_set", blank=True, null=True)
|
||||
|
||||
vzorak = models.ForeignKey(Text, verbose_name='vzorové řešení', blank=True, null=True)
|
||||
vzorak = models.ForeignKey(Text, verbose_name='vzorové řešení', related_name="uloha_vzorak_set", blank=True, null=True)
|
||||
|
||||
|
||||
cislo_zadani = models.ForeignKey(Cislo, verbose_name='číslo zadání', blank=True, null=True, related_name='zadane_ulohy')
|
||||
|
|
Loading…
Reference in a new issue