Opravena migrace na frankenmodel.
This commit is contained in:
parent
b1a953c9e4
commit
e9e7763575
2 changed files with 34 additions and 12 deletions
|
@ -271,10 +271,15 @@ class Migration(migrations.Migration):
|
|||
name='typ_prezentace',
|
||||
field=models.CharField(choices=[('veletrh', 'Veletrh (postery)'), ('prezentace', 'Prezentace (přednáška)')], default='veletrh', max_length=16, verbose_name='typ prezentace'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
migrations.RenameField(
|
||||
model_name='novinky',
|
||||
old_name='autor',
|
||||
new_name='autor_old'
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='novinky',
|
||||
name='autor',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Organizator', verbose_name='Autor novinky'),
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Organizator', verbose_name='Autor novinky', null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='novinky',
|
||||
|
@ -301,17 +306,32 @@ class Migration(migrations.Migration):
|
|||
name='studuje',
|
||||
field=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.'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
migrations.RenameField(
|
||||
model_name='pohadka',
|
||||
old_name='autor',
|
||||
new_name='autor_old'
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='pohadka',
|
||||
name='autor',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='seminar.Organizator', verbose_name='Autor pohádky'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
migrations.RenameField(
|
||||
model_name='pohadka',
|
||||
old_name='uloha',
|
||||
new_name='uloha_old'
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='pohadka',
|
||||
name='uloha',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pohadky', to='seminar.Uloha', verbose_name='Úloha'),
|
||||
field=models.ForeignKey(null=True,on_delete=django.db.models.deletion.CASCADE, related_name='pohadky', to='seminar.Uloha', verbose_name='Úloha'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
migrations.RenameField(
|
||||
model_name='problem',
|
||||
old_name='autor',
|
||||
new_name='autor_old',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='problem',
|
||||
name='autor',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='autor_problemu_problem', to='seminar.Organizator', verbose_name='autor problému'),
|
||||
|
@ -336,9 +356,10 @@ class Migration(migrations.Migration):
|
|||
name='forma',
|
||||
field=models.CharField(choices=[('papir', 'Papírové řešení'), ('email', 'Emailem'), ('upload', 'Upload přes web')], default='email', max_length=16, verbose_name='forma řešení'),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
migrations.RenameField(
|
||||
model_name='reseni',
|
||||
name='problem',
|
||||
old_name='problem',
|
||||
new_name='problem_old',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='resitel',
|
||||
|
@ -392,7 +413,7 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
migrations.AlterModelTable(
|
||||
name='problem',
|
||||
table='problem',
|
||||
table='seminar_problemy',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='uloha',
|
||||
|
|
|
@ -564,7 +564,7 @@ class Problem(SeminarModelBase):
|
|||
# Není abstraktní, protože se na něj jinak nedají dělat ForeignKeys.
|
||||
# TODO: Udělat to polymorfní (pomocí django-polymorphic), abychom dostali po těch vazbách přímo tu úlohu/témátko vč. fieldů, které nejsou součástí modelu Problem?
|
||||
#abstract = True
|
||||
db_table = 'problem'
|
||||
db_table = 'seminar_problemy'
|
||||
verbose_name = 'Problém'
|
||||
verbose_name_plural = 'Problémy'
|
||||
ordering = ['nazev']
|
||||
|
@ -889,7 +889,8 @@ class Pohadka(SeminarModelBase):
|
|||
uloha = models.ForeignKey(
|
||||
Uloha,
|
||||
verbose_name='Úloha',
|
||||
related_name='pohadky'
|
||||
related_name='pohadky',
|
||||
null=True
|
||||
)
|
||||
|
||||
# Kusů pohádky je v čísle obvykle o 1 více, než úloh. Jeden bude za úlohou
|
||||
|
@ -1293,7 +1294,7 @@ class Novinky(models.Model):
|
|||
],
|
||||
options={'quality': 95})
|
||||
|
||||
autor = models.ForeignKey(Organizator, verbose_name='Autor novinky')
|
||||
autor = models.ForeignKey(Organizator, verbose_name='Autor novinky', null=True)
|
||||
|
||||
zverejneno = models.BooleanField('Zveřejněno', default="False")
|
||||
|
||||
|
|
Loading…
Reference in a new issue