relink
This commit is contained in:
parent
1f0e6cccf6
commit
9e21b2ca1a
13 changed files with 180 additions and 24 deletions
|
@ -0,0 +1,30 @@
|
|||
# Generated by Django 4.2.11 on 2024-03-19 21:35
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('personalni', '0003_initial'),
|
||||
('korektury', '0021_auto_20240312_2124'),
|
||||
]
|
||||
|
||||
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'),
|
||||
),
|
||||
]
|
|
@ -20,7 +20,7 @@ from django.core.exceptions import ObjectDoesNotExist
|
|||
from django.utils.functional import cached_property
|
||||
from django.utils.text import get_valid_filename
|
||||
|
||||
from seminar.models import Organizator
|
||||
from personalni.models import Organizator
|
||||
|
||||
import subprocess
|
||||
from reversion import revisions as reversion
|
||||
|
|
20
prednasky/migrations/0014_alter_prednaska_org.py
Normal file
20
prednasky/migrations/0014_alter_prednaska_org.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Generated by Django 4.2.11 on 2024-03-19 21:35
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('personalni', '0003_initial'),
|
||||
('prednasky', '0013_auto_20240312_2124'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='prednaska',
|
||||
name='org',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='personalni.organizator'),
|
||||
),
|
||||
]
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
from django.db import models
|
||||
|
||||
from seminar.models import Organizator, Soustredeni
|
||||
from seminar.models import Soustredeni
|
||||
from personalni.models import Organizator
|
||||
|
||||
STAV_NAVRH = 1
|
||||
STAV_BUDE = 2
|
||||
|
|
85
seminar/migrations/0119_alter_konfera_ucastnici_and_more.py
Normal file
85
seminar/migrations/0119_alter_konfera_ucastnici_and_more.py
Normal file
|
@ -0,0 +1,85 @@
|
|||
# Generated by Django 4.2.11 on 2024-03-19 21:35
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('personalni', '0003_initial'),
|
||||
('seminar', '0118_alter_organizator_options_alter_osoba_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
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_%(class)s', 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_%(class)s', 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_%(class)s', 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'),
|
||||
),
|
||||
]
|
|
@ -1,10 +1,10 @@
|
|||
from .tvorba import *
|
||||
from .odevzdavatko import *
|
||||
from .base import *
|
||||
from .personalni import *
|
||||
from .soustredeni import *
|
||||
from .pomocne import *
|
||||
from .treenode import *
|
||||
from .novinky import *
|
||||
|
||||
from various.models import Nastaveni
|
||||
from personalni.models import Organizator, Resitel, Skola, Prijemce, Osoba
|
||||
|
|
|
@ -4,7 +4,7 @@ from imagekit.processors import ResizeToFit
|
|||
|
||||
from reversion import revisions as reversion
|
||||
|
||||
from . import personalni as pm
|
||||
from personalni.models import Organizator
|
||||
|
||||
@reversion.register(ignore_duplicates=True)
|
||||
class Novinky(models.Model):
|
||||
|
@ -26,7 +26,7 @@ class Novinky(models.Model):
|
|||
],
|
||||
options={'quality': 95})
|
||||
|
||||
autor = models.ForeignKey(pm.Organizator, verbose_name='Autor novinky', null=True,
|
||||
autor = models.ForeignKey(Organizator, verbose_name='Autor novinky', null=True,
|
||||
on_delete=models.SET_NULL)
|
||||
|
||||
zverejneno = models.BooleanField('Zveřejněno', default=False)
|
||||
|
|
|
@ -10,11 +10,11 @@ from django.utils import timezone
|
|||
from django.conf import settings
|
||||
|
||||
from seminar.models import tvorba as am
|
||||
from seminar.models import personalni as pm
|
||||
from seminar.models import treenode as tm
|
||||
from seminar.models import base as bm
|
||||
|
||||
from seminar.utils import vzorecek_na_prepocet, inverze_vzorecku_na_prepocet
|
||||
from personalni.models import Resitel
|
||||
|
||||
|
||||
@reversion.register(ignore_duplicates=True)
|
||||
|
@ -34,7 +34,7 @@ class Reseni(bm.SeminarModelBase):
|
|||
problem = models.ManyToManyField(am.Problem, verbose_name='problém', help_text='Problém',
|
||||
through='Hodnoceni')
|
||||
|
||||
resitele = models.ManyToManyField(pm.Resitel, verbose_name='autoři řešení',
|
||||
resitele = models.ManyToManyField(Resitel, verbose_name='autoři řešení',
|
||||
help_text='Seznam autorů řešení', through='Reseni_Resitele')
|
||||
|
||||
|
||||
|
@ -229,7 +229,7 @@ class Reseni_Resitele(models.Model):
|
|||
# Interní ID
|
||||
id = models.AutoField(primary_key = True)
|
||||
|
||||
resitele = models.ForeignKey(pm.Resitel, verbose_name='řešitel', on_delete=models.PROTECT)
|
||||
resitele = models.ForeignKey(Resitel, verbose_name='řešitel', on_delete=models.PROTECT)
|
||||
|
||||
reseni = models.ForeignKey(Reseni, verbose_name='řešení', on_delete=models.CASCADE)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from reversion import revisions as reversion
|
|||
|
||||
from django.conf import settings
|
||||
|
||||
from . import personalni as pm
|
||||
from personalni.models import Resitel, Organizator
|
||||
|
||||
from .base import SeminarModelBase
|
||||
from seminar.models import tvorba as am
|
||||
|
@ -42,10 +42,10 @@ class Soustredeni(SeminarModelBase):
|
|||
misto = models.CharField('místo soustředění', max_length=256, blank=True, default='',
|
||||
help_text='Místo (název obce, volitelně též objektu')
|
||||
|
||||
ucastnici = models.ManyToManyField(pm.Resitel, verbose_name='účastníci soustředění',
|
||||
ucastnici = models.ManyToManyField(Resitel, verbose_name='účastníci soustředění',
|
||||
help_text='Seznam účastníků soustředění', through='Soustredeni_Ucastnici')
|
||||
|
||||
organizatori = models.ManyToManyField(pm.Organizator,
|
||||
organizatori = models.ManyToManyField(Organizator,
|
||||
verbose_name='Organizátoři soustředění',
|
||||
help_text='Seznam organizátorů soustředění',
|
||||
through='Soustredeni_Organizatori')
|
||||
|
@ -92,7 +92,7 @@ class Soustredeni_Ucastnici(SeminarModelBase):
|
|||
# Interní ID
|
||||
id = models.AutoField(primary_key = True)
|
||||
|
||||
resitel = models.ForeignKey(pm.Resitel, verbose_name='řešitel', on_delete=models.PROTECT)
|
||||
resitel = models.ForeignKey(Resitel, verbose_name='řešitel', on_delete=models.PROTECT)
|
||||
|
||||
soustredeni = models.ForeignKey(Soustredeni, verbose_name='soustředění',
|
||||
on_delete=models.PROTECT)
|
||||
|
@ -118,7 +118,7 @@ class Soustredeni_Organizatori(SeminarModelBase):
|
|||
# Interní ID
|
||||
id = models.AutoField(primary_key = True)
|
||||
|
||||
organizator = models.ForeignKey(pm.Organizator, verbose_name='organizátor',
|
||||
organizator = models.ForeignKey(Organizator, verbose_name='organizátor',
|
||||
on_delete=models.PROTECT)
|
||||
|
||||
soustredeni = models.ForeignKey(Soustredeni, verbose_name='soustředění',
|
||||
|
@ -163,7 +163,7 @@ class Konfera(am.Problem):
|
|||
help_text='Abstrakt konfery tak, jak byl uveden ve sborníku')
|
||||
|
||||
# FIXME: Umíme omezit jen na účastníky daného soustřeďka?
|
||||
ucastnici = models.ManyToManyField(pm.Resitel, verbose_name='účastníci konfery',
|
||||
ucastnici = models.ManyToManyField(Resitel, verbose_name='účastníci konfery',
|
||||
help_text='Seznam účastníků konfery', through='Konfery_Ucastnici')
|
||||
|
||||
soustredeni = models.ForeignKey(Soustredeni, verbose_name='soustředění',
|
||||
|
@ -204,7 +204,7 @@ class Konfery_Ucastnici(models.Model):
|
|||
# Interní ID
|
||||
id = models.AutoField(primary_key = True)
|
||||
|
||||
resitel = models.ForeignKey(pm.Resitel, verbose_name='řešitel', on_delete=models.PROTECT)
|
||||
resitel = models.ForeignKey(Resitel, verbose_name='řešitel', on_delete=models.PROTECT)
|
||||
|
||||
konfera = models.ForeignKey(Konfera, verbose_name='konfera', on_delete=models.CASCADE)
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ from unidecode import unidecode # Používám pro získání ID odkazu (ještě
|
|||
|
||||
from polymorphic.models import PolymorphicModel
|
||||
|
||||
from . import personalni as pm
|
||||
from personalni.models import Organizator
|
||||
|
||||
from .pomocne import Text
|
||||
|
||||
|
@ -166,7 +166,7 @@ class OrgTextNode(TreeNode):
|
|||
verbose_name = 'Organizátorský článek (Node)'
|
||||
verbose_name_plural = 'Organizátorské články (Node)'
|
||||
|
||||
organizator = models.ForeignKey(pm.Organizator,
|
||||
organizator = models.ForeignKey(Organizator,
|
||||
null=False,
|
||||
blank=False,
|
||||
on_delete=models.DO_NOTHING,
|
||||
|
|
|
@ -34,7 +34,7 @@ from polymorphic.models import PolymorphicModel
|
|||
from django.core.mail import EmailMessage
|
||||
from seminar.utils import aktivniResitele
|
||||
|
||||
from . import personalni as pm
|
||||
from personalni.models import Prijemce, Organizator
|
||||
|
||||
from .base import SeminarModelBase
|
||||
|
||||
|
@ -306,7 +306,7 @@ class Cislo(SeminarModelBase):
|
|||
resitele_vsichni.filter(zasilat_cislo_papirove=True))
|
||||
|
||||
paticka_prijemce = "---\nPokud tyto e-maily nechcete nadále dostávat, prosíme, ozvěte se nám na mam@matfyz.cz."
|
||||
posli(predmet, text_mailu + paticka_prijemce, pm.Prijemce.objects.filter(zasilat_cislo_emailem=True))
|
||||
posli(predmet, text_mailu + paticka_prijemce, Prijemce.objects.filter(zasilat_cislo_emailem=True))
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
super().save(*args, **kwargs)
|
||||
|
@ -462,15 +462,15 @@ class Problem(SeminarModelBase,PolymorphicModel):
|
|||
poznamka = models.TextField('org poznámky (HTML)', blank=True,
|
||||
help_text='Neveřejný návrh úlohy, návrh řešení, text zadání, poznámky ...')
|
||||
|
||||
autor = models.ForeignKey(pm.Organizator, verbose_name='autor problému',
|
||||
autor = models.ForeignKey(Organizator, verbose_name='autor problému',
|
||||
related_name='autor_problemu_%(class)s', null=True, blank=True,
|
||||
on_delete=models.SET_NULL)
|
||||
|
||||
garant = models.ForeignKey(pm.Organizator, verbose_name='garant zadaného problému',
|
||||
garant = models.ForeignKey(Organizator, verbose_name='garant zadaného problému',
|
||||
related_name='garant_problemu_%(class)s', null=True, blank=True,
|
||||
on_delete=models.SET_NULL)
|
||||
|
||||
opravovatele = models.ManyToManyField(pm.Organizator, verbose_name='opravovatelé',
|
||||
opravovatele = models.ManyToManyField(Organizator, verbose_name='opravovatelé',
|
||||
blank=True, related_name='opravovatele_%(class)s')
|
||||
|
||||
kod = models.CharField('lokální kód', max_length=32, blank=True, default='',
|
||||
|
@ -691,7 +691,7 @@ class Pohadka(SeminarModelBase):
|
|||
id = models.AutoField(primary_key=True)
|
||||
|
||||
autor = models.ForeignKey(
|
||||
pm.Organizator,
|
||||
Organizator,
|
||||
verbose_name="Autor pohádky",
|
||||
|
||||
# Při nahrávání z TeXu není vyplnění vyžadováno, v adminu je
|
||||
|
|
20
sifrovacka/migrations/0005_alter_odpoveducastnika_resitel.py
Normal file
20
sifrovacka/migrations/0005_alter_odpoveducastnika_resitel.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Generated by Django 4.2.11 on 2024-03-19 21:35
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('personalni', '0003_initial'),
|
||||
('sifrovacka', '0004_auto_20240312_2124'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='odpoveducastnika',
|
||||
name='resitel',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='personalni.resitel'),
|
||||
),
|
||||
]
|
|
@ -1,7 +1,7 @@
|
|||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
from seminar.models.personalni import Resitel
|
||||
from personalni.models import Resitel
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
|
Loading…
Reference in a new issue