Migrace a přejmenování tabulek modelů personálního
This commit is contained in:
parent
ebf8165c53
commit
75a7e607d5
5 changed files with 347 additions and 4 deletions
35
korektury/migrations/0021_auto_20230731_1954.py
Normal file
35
korektury/migrations/0021_auto_20230731_1954.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Generated by Django 2.2.28 on 2023-07-31 17:54
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('korektury', '0020_lepsi_popis_nazvu_PDF_v_adminu'),
|
||||
('personalni', '0002_organizator_osoba_prijemce_resitel_skola'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.SeparateDatabaseAndState(
|
||||
state_operations=[
|
||||
migrations.AlterField(
|
||||
model_name='komentar',
|
||||
name='autor',
|
||||
field=models.ForeignKey(blank=True, help_text='Autor komentáře', null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.Organizator'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='korekturovanepdf',
|
||||
name='org',
|
||||
field=models.ForeignKey(blank=True, default=None, help_text='Zodpovědný organizátor za obsah', null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.Organizator'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='oprava',
|
||||
name='autor',
|
||||
field=models.ForeignKey(blank=True, help_text='Autor opravy', null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.Organizator'),
|
||||
),
|
||||
],
|
||||
database_operations=[],
|
||||
),
|
||||
]
|
|
@ -0,0 +1,134 @@
|
|||
# Generated by Django 2.2.28 on 2023-07-31 17:54
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
import django_countries.fields
|
||||
import imagekit.models.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('personalni', '0001_skupiny'),
|
||||
('seminar', '0114_separace_personalniho'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.SeparateDatabaseAndState(
|
||||
state_operations=[
|
||||
migrations.CreateModel(
|
||||
name='Osoba',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('jmeno', models.CharField(max_length=256, verbose_name='jméno')),
|
||||
('prijmeni', models.CharField(max_length=256, verbose_name='příjmení')),
|
||||
('prezdivka', models.CharField(blank=True, max_length=256, null=True, verbose_name='přezdívka')),
|
||||
('pohlavi_muz', models.BooleanField(default=False, verbose_name='pohlaví (muž)')),
|
||||
('email', models.EmailField(blank=True, default='', max_length=256, verbose_name='e-mail')),
|
||||
('telefon', models.CharField(blank=True, default='', max_length=256, verbose_name='telefon')),
|
||||
('datum_narozeni', models.DateField(blank=True, null=True, verbose_name='datum narození')),
|
||||
('datum_souhlasu_udaje', models.DateField(blank=True, help_text='Datum souhlasu se zpracováním osobních údajů', null=True, verbose_name='datum souhlasu (údaje)')),
|
||||
('datum_souhlasu_zasilani', models.DateField(blank=True, help_text='Datum souhlasu se zasíláním MFF materiálů', null=True, verbose_name='datum souhlasu (spam)')),
|
||||
('datum_registrace', models.DateField(default=django.utils.timezone.now, verbose_name='datum registrace do semináře')),
|
||||
('ulice', models.CharField(blank=True, default='', max_length=256, verbose_name='ulice')),
|
||||
('mesto', models.CharField(blank=True, default='', max_length=256, verbose_name='město')),
|
||||
('psc', models.CharField(blank=True, default='', max_length=32, verbose_name='PSČ')),
|
||||
('stat', django_countries.fields.CountryField(default='CZ', help_text='ISO 3166-1 kód země velkými písmeny (CZ, SK, ...)', max_length=2, verbose_name='stát')),
|
||||
('jak_se_dozvedeli', models.TextField(blank=True, verbose_name='Jak se dozvěděli')),
|
||||
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k osobě (plain text)', verbose_name='neveřejná poznámka')),
|
||||
('foto', imagekit.models.fields.ProcessedImageField(blank=True, help_text='Vlož fotografii osoby o libovolné velikosti', null=True, upload_to='image_osoby/velke/%Y/', verbose_name='Fotografie osoby')),
|
||||
('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='uživatel')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Osoba',
|
||||
'verbose_name_plural': 'Osoby',
|
||||
'db_table': 'mam_osoby',
|
||||
'ordering': ['prijmeni', 'jmeno'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Skola',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('aesop_id', models.CharField(blank=True, default='', help_text='Aesopi ID typu "izo:..." nebo "aesop:..."', max_length=32, verbose_name='Aesop ID')),
|
||||
('izo', models.CharField(blank=True, help_text='IZO školy (jen české školy)', max_length=32, verbose_name='IZO')),
|
||||
('nazev', models.CharField(help_text='Celý název školy', max_length=256, verbose_name='název')),
|
||||
('kratky_nazev', models.CharField(blank=True, help_text='Zkrácený název pro zobrazení ve výsledkovce', max_length=256, verbose_name='zkrácený název')),
|
||||
('ulice', models.CharField(max_length=256, verbose_name='ulice')),
|
||||
('mesto', models.CharField(max_length=256, verbose_name='město')),
|
||||
('psc', models.CharField(max_length=32, verbose_name='PSČ')),
|
||||
('stat', django_countries.fields.CountryField(default='CZ', help_text='ISO 3166-1 kód země velkými písmeny (CZ, SK, ...)', max_length=2, verbose_name='stát')),
|
||||
('je_zs', models.BooleanField(default=True, verbose_name='základní stupeň')),
|
||||
('je_ss', models.BooleanField(default=True, verbose_name='střední stupeň')),
|
||||
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka ke škole (plain text)', verbose_name='neveřejná poznámka')),
|
||||
('kontaktni_osoba', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.Osoba', verbose_name='Kontaktní osoba')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Škola',
|
||||
'verbose_name_plural': 'Školy',
|
||||
'db_table': 'mam_skoly',
|
||||
'ordering': ['mesto', 'nazev'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Resitel',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('prezdivka_resitele', models.CharField(blank=True, max_length=256, null=True, unique=True, verbose_name='přezdívka řešitele')),
|
||||
('rok_maturity', models.IntegerField(blank=True, null=True, verbose_name='rok maturity')),
|
||||
('zasilat', models.CharField(choices=[('domu', 'Domů'), ('do_skoly', 'Do školy'), ('nikam', 'Nezasílat papírově')], default='domu', max_length=32, verbose_name='kam zasílat')),
|
||||
('zasilat_cislo_emailem', models.BooleanField(default=False, help_text='True pokud chce řešitel dostávat číslo emailem', verbose_name='zasílat číslo emailem')),
|
||||
('zasilat_cislo_papirove', models.BooleanField(default=True, help_text='True pokud chce řešitel dostávat číslo papírově', verbose_name='zasílat číslo papírově')),
|
||||
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k řešiteli (plain text)', verbose_name='neveřejná poznámka')),
|
||||
('osoba', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='personalni.Osoba', verbose_name='osoba')),
|
||||
('skola', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.Skola', verbose_name='škola')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Řešitel',
|
||||
'verbose_name_plural': 'Řešitelé',
|
||||
'db_table': 'mam_resitele',
|
||||
'ordering': ['osoba'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Prijemce',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k příemci čísel (plain text)', verbose_name='neveřejná poznámka')),
|
||||
('zasilat_cislo_emailem', models.BooleanField(default=False, help_text='True pokud chce příjemce dostávat číslo emailem', verbose_name='zasílat číslo emailem')),
|
||||
('osoba', models.OneToOneField(help_text='Které osobě či na jakou adresu se mají zasílat čísla', on_delete=django.db.models.deletion.CASCADE, to='personalni.Osoba', verbose_name='komu')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'příjemce',
|
||||
'verbose_name_plural': 'příjemce',
|
||||
'db_table': 'mam_prijemce',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Organizator',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('vytvoreno', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False, verbose_name='Vytvořeno')),
|
||||
('organizuje_od', models.DateTimeField(blank=True, null=True, verbose_name='Organizuje od')),
|
||||
('organizuje_do', models.DateTimeField(blank=True, null=True, verbose_name='Organizuje do')),
|
||||
('studuje', models.CharField(blank=True, help_text="Např. 'Studuje Obecnou fyziku (Bc.), 3. ročník', 'Vystudovala Diskrétní modely a algoritmy (Mgr.)' nebo 'Přednáší na MFF'", max_length=256, null=True, verbose_name='Studium aj.')),
|
||||
('strucny_popis_organizatora', models.TextField(blank=True, null=True, verbose_name='Stručný popis organizátora')),
|
||||
('skola', models.CharField(blank=True, help_text='Škola, např. MFF, VŠCHT, VUT, ... prostě aby se nemuselo psát do studuješkolu, ale jen obor, možnost zobrazit zvlášť', max_length=256, null=True, verbose_name='Škola, kterou studuje')),
|
||||
('osoba', models.OneToOneField(help_text='osobní údaje organizátora', on_delete=django.db.models.deletion.PROTECT, related_name='org', to='personalni.Osoba', verbose_name='osoba')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Organizátor',
|
||||
'verbose_name_plural': 'Organizátoři',
|
||||
'db_table': 'mam_organizatori',
|
||||
'ordering': ['-organizuje_do', 'osoba__jmeno', 'osoba__prijmeni'],
|
||||
},
|
||||
),
|
||||
],
|
||||
database_operations=[],
|
||||
),
|
||||
]
|
||||
|
|
@ -20,7 +20,7 @@ logger = logging.getLogger(__name__)
|
|||
class Osoba(SeminarModelBase):
|
||||
|
||||
class Meta:
|
||||
db_table = 'seminar_osoby'
|
||||
db_table = 'mam_osoby'
|
||||
verbose_name = 'Osoba'
|
||||
verbose_name_plural = 'Osoby'
|
||||
ordering = ['prijmeni','jmeno']
|
||||
|
@ -119,7 +119,7 @@ class Osoba(SeminarModelBase):
|
|||
class Skola(SeminarModelBase):
|
||||
# Mělo by být částečně vytaženo z Aesopa
|
||||
class Meta:
|
||||
db_table = 'seminar_skoly'
|
||||
db_table = 'mam_skoly'
|
||||
verbose_name = 'Škola'
|
||||
verbose_name_plural = 'Školy'
|
||||
ordering = ['mesto', 'nazev']
|
||||
|
@ -172,7 +172,7 @@ class Skola(SeminarModelBase):
|
|||
|
||||
class Prijemce(SeminarModelBase):
|
||||
class Meta:
|
||||
db_table = 'seminar_prijemce'
|
||||
db_table = 'mam_prijemce'
|
||||
verbose_name = 'příjemce'
|
||||
verbose_name_plural = 'příjemce'
|
||||
|
||||
|
@ -200,7 +200,7 @@ class Prijemce(SeminarModelBase):
|
|||
class Resitel(SeminarModelBase):
|
||||
|
||||
class Meta:
|
||||
db_table = 'seminar_resitele'
|
||||
db_table = 'mam_resitele'
|
||||
verbose_name = 'Řešitel'
|
||||
verbose_name_plural = 'Řešitelé'
|
||||
ordering = ['osoba']
|
||||
|
@ -409,6 +409,7 @@ class Organizator(SeminarModelBase):
|
|||
return "{} {}".format(self.osoba.jmeno, self.osoba.prijmeni)
|
||||
|
||||
class Meta:
|
||||
db_table = 'mam_organizatori'
|
||||
verbose_name = 'Organizátor'
|
||||
verbose_name_plural = 'Organizátoři'
|
||||
# Řadí aktivní orgy na začátek, pod tím v pořadí od nejstarších neaktivní orgy.
|
||||
|
|
25
prednasky/migrations/0013_auto_20230731_1954.py
Normal file
25
prednasky/migrations/0013_auto_20230731_1954.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Generated by Django 2.2.28 on 2023-07-31 17:54
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('prednasky', '0012_auto_20190610_2358'),
|
||||
('personalni', '0002_organizator_osoba_prijemce_resitel_skola'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.SeparateDatabaseAndState(
|
||||
state_operations=[
|
||||
migrations.AlterField(
|
||||
model_name='prednaska',
|
||||
name='org',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='personalni.Organizator'),
|
||||
),
|
||||
],
|
||||
database_operations=[],
|
||||
),
|
||||
]
|
148
seminar/migrations/0114_separace_personalniho.py
Normal file
148
seminar/migrations/0114_separace_personalniho.py
Normal file
|
@ -0,0 +1,148 @@
|
|||
# Generated by Django 2.2.28 on 2023-07-31 17:54
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('korektury', '0020_lepsi_popis_nazvu_PDF_v_adminu'),
|
||||
('prednasky', '0012_auto_20190610_2358'),
|
||||
('personalni', '0001_skupiny'),
|
||||
('seminar', '0113_resitel_zasilat_cislo_papirove'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.SeparateDatabaseAndState(
|
||||
state_operations=[
|
||||
migrations.RemoveField(
|
||||
model_name='osoba',
|
||||
name='user',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='prijemce',
|
||||
name='osoba',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='resitel',
|
||||
name='osoba',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='resitel',
|
||||
name='skola',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='skola',
|
||||
name='kontaktni_osoba',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='konfera',
|
||||
name='ucastnici',
|
||||
field=models.ManyToManyField(help_text='Seznam účastníků konfery', through='seminar.Konfery_Ucastnici', to='personalni.Resitel', verbose_name='účastníci konfery'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='konfery_ucastnici',
|
||||
name='resitel',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='personalni.Resitel', verbose_name='řešitel'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='novinky',
|
||||
name='autor',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.Organizator', verbose_name='Autor novinky'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='orgtextnode',
|
||||
name='organizator',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='personalni.Organizator', verbose_name='Organizátor'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='pohadka',
|
||||
name='autor',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.Organizator', verbose_name='Autor pohádky'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='autor',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='autor_problemu_problem', to='personalni.Organizator', verbose_name='autor problému'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='garant',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='garant_problemu_problem', to='personalni.Organizator', verbose_name='garant zadaného problému'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='opravovatele',
|
||||
field=models.ManyToManyField(blank=True, related_name='opravovatele_problem', to='personalni.Organizator', verbose_name='opravovatelé'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='reseni',
|
||||
name='resitele',
|
||||
field=models.ManyToManyField(help_text='Seznam autorů řešení', through='seminar.Reseni_Resitele', to='personalni.Resitel', verbose_name='autoři řešení'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='reseni_resitele',
|
||||
name='resitele',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='personalni.Resitel', verbose_name='řešitel'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='soustredeni',
|
||||
name='organizatori',
|
||||
field=models.ManyToManyField(help_text='Seznam organizátorů soustředění', through='seminar.Soustredeni_Organizatori', to='personalni.Organizator', verbose_name='Organizátoři soustředění'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='soustredeni',
|
||||
name='ucastnici',
|
||||
field=models.ManyToManyField(help_text='Seznam účastníků soustředění', through='seminar.Soustredeni_Ucastnici', to='personalni.Resitel', verbose_name='účastníci soustředění'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='soustredeni_organizatori',
|
||||
name='organizator',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='personalni.Organizator', verbose_name='organizátor'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='soustredeni_ucastnici',
|
||||
name='resitel',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='personalni.Resitel', verbose_name='řešitel'),
|
||||
),
|
||||
],
|
||||
database_operations=[],
|
||||
),
|
||||
migrations.SeparateDatabaseAndState(
|
||||
state_operations=[
|
||||
migrations.DeleteModel(
|
||||
name='Organizator',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='Osoba',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='Prijemce',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='Resitel',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='Skola',
|
||||
),
|
||||
],
|
||||
database_operations=[
|
||||
migrations.AlterModelTable(
|
||||
name='Organizator', table="mam_organizatori",
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='Osoba', table="mam_osoby",
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='Prijemce', table="mam_prijemce",
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='Resitel', table="mam_resitele",
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='Skola', table="mam_skoly",
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
Loading…
Reference in a new issue