Pridany atributy Skole SS a ZS
This commit is contained in:
parent
6947131a03
commit
29b32dadd8
4 changed files with 45 additions and 7 deletions
|
@ -15,11 +15,12 @@ admin.site.register(Nastaveni, SingletonModelAdmin)
|
|||
|
||||
class SkolaAdmin(reversion.VersionAdmin):
|
||||
fieldsets = [
|
||||
(None, {'fields': ['nazev', 'kratky_nazev']}),
|
||||
(None, {'fields': ['nazev', 'kratky_nazev', 'je_zs', 'je_ss']}),
|
||||
(u'Interní ID', {'fields': ['aesop_id', 'izo'], 'classes': ['collapse']}),
|
||||
(u'Adresa', {'fields': ['ulice', 'mesto', 'psc', 'stat']}),
|
||||
]
|
||||
list_display = ['nazev', 'aesop_id', 'mesto', 'ulice', 'stat']
|
||||
list_display = ['nazev', 'aesop_id', 'mesto', 'ulice', 'stat', 'je_zs', 'je_ss']
|
||||
list_filter = ['stat', 'je_zs', 'je_ss']
|
||||
search_fields = ['nazev', 'mesto', 'ulice']
|
||||
|
||||
admin.site.register(Skola, SkolaAdmin)
|
||||
|
|
32
seminar/migrations/0003_add_skola_zs_ss.py
Normal file
32
seminar/migrations/0003_add_skola_zs_ss.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('seminar', '0002_add_body_views'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skola',
|
||||
name='je_ss',
|
||||
field=models.BooleanField(default=True, verbose_name='st\u0159edn\xed stupe\u0148'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skola',
|
||||
name='je_zs',
|
||||
field=models.BooleanField(default=True, verbose_name='z\xe1kladn\xed stupe\u0148'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='reseni',
|
||||
name='poznamka',
|
||||
field=models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \u0159e\u0161en\xed (plain text, editace v detailu \u0159e\u0161en\xed)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -88,6 +88,10 @@ class Skola(SeminarModelBase):
|
|||
stat = CountryField(u'stát', default='CZ',
|
||||
help_text=u'ISO 3166-1 kód zeme velkými písmeny (CZ, SK, ...)')
|
||||
|
||||
# Jaké vzdělání škpla poskytuje?
|
||||
je_zs = models.BooleanField(u'základní stupeň', default=True)
|
||||
je_ss = models.BooleanField(u'střední stupeň', default=True)
|
||||
|
||||
poznamka = models.TextField(u'neveřejná poznámka', blank=True,
|
||||
help_text=u'Neveřejná poznámka ke škole (plain text)')
|
||||
|
||||
|
|
|
@ -27,11 +27,12 @@ def create_test_data(size = 6, rnd = None):
|
|||
orgs.append(o)
|
||||
|
||||
# skoly
|
||||
Skola.objects.create(mesto = u'Praha', stat='CZ', psc='101 00', ulice=u'Krátká 5', nazev=u'První SŠ')
|
||||
Skola.objects.create(mesto = u'Praha', stat='CZ', psc='102 00', ulice=u'Dlouhá 5', nazev=u'Druhá SŠ')
|
||||
Skola.objects.create(mesto = u'Praha', stat='CZ', psc='103 00', ulice=u'Široká 3', nazev=u'Třetí SŠ')
|
||||
Skola.objects.create(mesto = u'Ostrava', stat='CZ', psc='700 00', ulice=u'Hluboká 42', nazev=u'Hutní gympl')
|
||||
Skola.objects.create(mesto = u'Humenné', stat='SK', psc='012 34', ulice=u'Pltká 1', nazev=u'Sredná škuola')
|
||||
Skola.objects.create(mesto = u'Praha', stat='CZ', psc='101 00', ulice=u'Krátká 5', nazev=u'První ZŠ', je_zs=True, je_ss=False)
|
||||
Skola.objects.create(mesto = u'Praha', stat='CZ', psc='101 00', ulice=u'Krátká 5', nazev=u'První SŠ', je_zs=False, je_ss=True)
|
||||
Skola.objects.create(mesto = u'Praha', stat='CZ', psc='102 00', ulice=u'Dlouhá 5', nazev=u'Druhá SŠ', je_zs=False, je_ss=True)
|
||||
Skola.objects.create(mesto = u'Praha', stat='CZ', psc='103 00', ulice=u'Široká 3', nazev=u'Třetí SŠ a ZŠ', je_zs=True, je_ss=True)
|
||||
Skola.objects.create(mesto = u'Ostrava', stat='CZ', psc='700 00', ulice=u'Hluboká 42', nazev=u'Hutní gympl', je_zs=False, je_ss=True)
|
||||
Skola.objects.create(mesto = u'Humenné', stat='SK', psc='012 34', ulice=u'Pltká 1', nazev=u'Sredná škuola', je_zs=False, je_ss=True)
|
||||
|
||||
# resitele
|
||||
jmena_m = ['Aleš', 'Tomáš', 'Martin', 'Jakub', 'Petr', 'Lukáš', 'Cyril']
|
||||
|
|
Loading…
Reference in a new issue