Update admin (forma), lepsi nazvy sloupcu z importu
This commit is contained in:
parent
8117261725
commit
dc5d138ebf
3 changed files with 60 additions and 18 deletions
|
@ -37,7 +37,6 @@ class ResitelAdmin(reversion.VersionAdmin):
|
|||
(u'Adresa', {'fields': ['ulice', 'mesto', 'psc', 'stat']}),
|
||||
]
|
||||
list_display = ['jmeno', 'prijmeni', 'user', 'pohlavi_muz', 'skola', 'rok_maturity']
|
||||
list_display_links = ['skola']
|
||||
list_filter = ['pohlavi_muz', 'rok_maturity', 'zasilat']
|
||||
search_fields = ['jmeno', 'prijmeni', 'ulice', 'user', 'mesto', 'email']
|
||||
|
||||
|
@ -52,7 +51,6 @@ class CisloAdmin(reversion.VersionAdmin):
|
|||
(u'Data', {'fields': ['datum_vydani', 'datum_deadline']}),
|
||||
]
|
||||
list_display = ['kod', 'rocnik', 'cislo', 'datum_vydani', 'datum_deadline', 'verejne']
|
||||
list_display_links = ['cislo', 'kod']
|
||||
list_filter = ['rocnik']
|
||||
view_on_site = Cislo.verejne_url
|
||||
|
||||
|
@ -85,7 +83,6 @@ class PrilohaReseniAdmin(reversion.VersionAdmin):
|
|||
(u'Poznámky', {'fields': ['poznamka']}),
|
||||
]
|
||||
list_display = ['reseni', 'soubor', 'timestamp']
|
||||
list_display_links = ['reseni']
|
||||
list_filter = ['reseni', 'timestamp']
|
||||
search_fields = []
|
||||
|
||||
|
@ -101,12 +98,11 @@ class PrilohaReseniInline(admin.StackedInline):
|
|||
class ReseniAdmin(reversion.VersionAdmin):
|
||||
readonly_fields = ['timestamp']
|
||||
fieldsets = [
|
||||
(None, {'fields': ['problem', 'resitel', 'body', 'cislo_body', 'timestamp']}),
|
||||
(None, {'fields': ['problem', 'resitel', 'forma', 'body', 'cislo_body', 'timestamp']}),
|
||||
(u'Poznámky', {'fields': ['poznamka']}),
|
||||
]
|
||||
list_display = ['problem', 'resitel', 'body', 'timestamp']
|
||||
list_display_links = ['problem', 'resitel']
|
||||
list_filter = ['body', 'timestamp']
|
||||
list_display = ['problem', 'resitel', 'forma', 'body', 'timestamp']
|
||||
list_filter = ['body', 'timestamp', 'forma']
|
||||
search_fields = []
|
||||
inlines = [PrilohaReseniInline]
|
||||
|
||||
|
@ -137,7 +133,6 @@ class ProblemAdmin(reversion.VersionAdmin):
|
|||
]
|
||||
list_display = ['nazev', 'typ', 'kod', 'stav', 'autor', 'opravovatel', 'verejne', 'cislo_zadani']
|
||||
list_select_related = True
|
||||
list_display_links = ['nazev']
|
||||
list_filter = ['typ', 'stav', 'autor', 'opravovatel']
|
||||
search_fields = ['nazev', 'kod', 'text_problemu_org', 'text_problemu']
|
||||
inlines = [ReseniInline]
|
||||
|
|
47
seminar/migrations/0009_rename_imported_IDs.py
Normal file
47
seminar/migrations/0009_rename_imported_IDs.py
Normal file
|
@ -0,0 +1,47 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('seminar', '0008_reseni_forma'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='problem',
|
||||
old_name='dakos_id',
|
||||
new_name='import_dakos_id',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='resitel',
|
||||
old_name='dakos_id',
|
||||
new_name='import_mamoper_id',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='skola',
|
||||
old_name='dakos_id',
|
||||
new_name='import_dakos_id',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='import_dakos_id',
|
||||
field=models.CharField(default=b'', help_text='ID z importu z DAKOSU s prefixem podle p\u016fvodu: "AZAD:xxx (MAMOPER.MM_AZAD), ""DOZ:xxx" (MAMOPER.MM_DOZ), "ZAD:rocnik.cislo.uloha.typ" (MAMOPER.MM_ZADANIA)', max_length=32, verbose_name='importovan\xe9 ID s typem', blank=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='resitel',
|
||||
name='import_mamoper_id',
|
||||
field=models.CharField(default=b'', help_text='MAMOPER.MM_RIESITELIA.ID z DAKOS importu, jen historick\xfd v\xfdznam', max_length=32, verbose_name='importovan\xe9 MM_RIESITELIA.ID', blank=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skola',
|
||||
name='import_dakos_id',
|
||||
field=models.CharField(default=b'', help_text='DKSROOT.V_SKOLA.ID z DAKOS importu, jen historick\xfd v\xfdznam', max_length=32, verbose_name='importovan\xe9 DKSROOT.V_SKOLA.ID', blank=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -64,9 +64,9 @@ class Skola(SeminarModelBase):
|
|||
aesop_id = models.CharField(u'Aesop ID', max_length=32, blank=True, default='',
|
||||
help_text=u'Aesopi ID typu "izo:..." nebo "aesop:..."')
|
||||
|
||||
# Staré ID z DAKOSU -- jen u importovaných záznamů
|
||||
dakos_id = models.CharField(u'Stare DaKoS ID', max_length=32, blank=True, default='',
|
||||
help_text=u'DaKoS ID z exportu, jen historický význam, podle tabulky dksroot.V_skola')
|
||||
# Staré (do 2015) MAMOPER.MM_RIESITELIA.ID z DAKOSu -- jen u importovaných záznamů
|
||||
import_dakos_id = models.CharField(u'importované DKSROOT.V_SKOLA.ID', max_length=32, blank=True, default='',
|
||||
help_text=u'DKSROOT.V_SKOLA.ID z DAKOS importu, jen historický význam')
|
||||
|
||||
# IZO školy (jen české školy)
|
||||
izo = models.CharField(u'IZO', max_length=32, blank=True,
|
||||
|
@ -174,9 +174,9 @@ class Resitel(SeminarModelBase):
|
|||
poznamka = models.TextField(u'neveřejná poznámka', blank=True,
|
||||
help_text=u'Neveřejná poznámka k řešiteli (plain text)')
|
||||
|
||||
# Staré ID z DAKOSU -- jen u importovaných záznamů
|
||||
dakos_id = models.CharField(u'Stare DaKoS ID', max_length=32, blank=True, default='',
|
||||
help_text=u'DaKoS ID z exportu, jen historický význam, podle tabulky mamoper.MM_RIESITELIA')
|
||||
# Staré (do 2015) MAMOPER.MM_RIESITELIA.ID z DAKOS -- jen u importovaných záznamů
|
||||
import_mamoper_id = models.CharField(u'importované MM_RIESITELIA.ID', max_length=32, blank=True, default='',
|
||||
help_text=u'MAMOPER.MM_RIESITELIA.ID z DAKOS importu, jen historický význam')
|
||||
|
||||
def plne_jmeno(self):
|
||||
return force_unicode(u'%s %s' % (self.jmeno, self.prijmeni))
|
||||
|
@ -334,10 +334,10 @@ class Problem(SeminarModelBase):
|
|||
|
||||
timestamp = models.DateTimeField(u'vytvořeno', auto_now=True)
|
||||
|
||||
# Staré ID z DAKOSU -- jen u importovaných záznamů
|
||||
dakos_id = models.CharField(u'Staré DaKoS ID', max_length=32, blank=True, default='',
|
||||
help_text=(u'DaKoS ID z exportu, s prefixem podle původu: "AZAD:xxx (z MM_AZAD), "' +
|
||||
u'"DOZ:xxx" (z MM_DOZ), "ZAD:rocnik.cislo.uloha.typ" (z MM_ZADANIA)'))
|
||||
# Staré (do 2014) ID problému z DAKOSU -- jen u importovaných záznamů
|
||||
import_dakos_id = models.CharField(u'importované ID s typem', max_length=32, blank=True, default='',
|
||||
help_text=(u'ID z importu z DAKOSU s prefixem podle původu: "AZAD:xxx (MAMOPER.MM_AZAD), "' +
|
||||
u'"DOZ:xxx" (MAMOPER.MM_DOZ), "ZAD:rocnik.cislo.uloha.typ" (MAMOPER.MM_ZADANIA)'))
|
||||
|
||||
def __str__(self):
|
||||
return force_unicode(u'%s (%s)' % (self.nazev, self.stav))
|
||||
|
|
Loading…
Reference in a new issue