Přesun Natavení z tvorby
This commit is contained in:
parent
5346da5107
commit
2b52ec028e
10 changed files with 51 additions and 38 deletions
|
@ -6,7 +6,8 @@ from django.shortcuts import get_object_or_404
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from personalni.models import Skola, Resitel
|
from personalni.models import Skola, Resitel
|
||||||
from seminar.models.tvorba import Problem, Nastaveni
|
from seminar.models.tvorba import Problem
|
||||||
|
from seminar.models.nastaveni import Nastaveni
|
||||||
from .helpers import LoginRequiredAjaxMixin
|
from .helpers import LoginRequiredAjaxMixin
|
||||||
|
|
||||||
# TODO filosofie - zkratky, jak v databázi, tak ve vyhledávání (SPŠE, GASOŠ, Kpt., soukr)
|
# TODO filosofie - zkratky, jak v databázi, tak ve vyhledávání (SPŠE, GASOŠ, Kpt., soukr)
|
||||||
|
|
|
@ -5,7 +5,8 @@ from django.forms.models import inlineformset_factory
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from personalni.models import Resitel
|
from personalni.models import Resitel
|
||||||
from seminar.models.tvorba import Problem, Deadline, Nastaveni
|
from seminar.models.tvorba import Problem, Deadline
|
||||||
|
from seminar.models.nastaveni import Nastaveni
|
||||||
from seminar.models.odevzdavatko import *
|
from seminar.models.odevzdavatko import *
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -17,7 +17,8 @@ from itertools import groupby
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from seminar.models.odevzdavatko import *
|
from seminar.models.odevzdavatko import *
|
||||||
from seminar.models.tvorba import Problem, Nastaveni, Rocnik, Deadline
|
from seminar.models.tvorba import Problem, Rocnik, Deadline
|
||||||
|
from seminar.models.nastaveni import Nastaveni
|
||||||
from personalni.models import Resitel, Organizator, Osoba
|
from personalni.models import Resitel, Organizator, Osoba
|
||||||
from . import forms as f
|
from . import forms as f
|
||||||
from .forms import OdevzdavatkoTabulkaFiltrForm as FiltrForm
|
from .forms import OdevzdavatkoTabulkaFiltrForm as FiltrForm
|
||||||
|
|
|
@ -11,7 +11,8 @@ from django.http import HttpResponse
|
||||||
|
|
||||||
from seminar.models.odevzdavatko import Hodnoceni
|
from seminar.models.odevzdavatko import Hodnoceni
|
||||||
from .models import *
|
from .models import *
|
||||||
from seminar.models.tvorba import Tema, Uloha, Clanek, Nastaveni
|
from seminar.models.tvorba import Tema, Uloha, Clanek
|
||||||
|
from seminar.models.nastaveni import Nastaveni
|
||||||
from seminar.models.soustredeni import Soustredeni
|
from seminar.models.soustredeni import Soustredeni
|
||||||
from .forms import PrihlaskaForm, ProfileEditForm, PoMaturiteProfileEditForm
|
from .forms import PrihlaskaForm, ProfileEditForm, PoMaturiteProfileEditForm
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,8 @@ from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
# Todo: reversion
|
# Todo: reversion
|
||||||
|
|
||||||
from seminar.models.tvorba import Rocnik, Cislo, Deadline, ZmrazenaVysledkovka, Problem, Uloha, Tema, Clanek, Nastaveni
|
from seminar.models.tvorba import Rocnik, Cislo, Deadline, ZmrazenaVysledkovka, Problem, Uloha, Tema, Clanek
|
||||||
|
from seminar.models.nastaveni import Nastaveni
|
||||||
from personalni.models import Resitel
|
from personalni.models import Resitel
|
||||||
from seminar.models.soustredeni import Konfera
|
from seminar.models.soustredeni import Konfera
|
||||||
from seminar.models.novinky import Novinky
|
from seminar.models.novinky import Novinky
|
||||||
|
|
37
seminar/models/nastaveni.py
Normal file
37
seminar/models/nastaveni.py
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
from django.db import models
|
||||||
|
from django.urls import reverse
|
||||||
|
from reversion import revisions as reversion
|
||||||
|
from solo.models import SingletonModel
|
||||||
|
|
||||||
|
from seminar.models.tvorba import Cislo
|
||||||
|
|
||||||
|
|
||||||
|
@reversion.register(ignore_duplicates=True)
|
||||||
|
class Nastaveni(SingletonModel):
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
db_table = 'seminar_nastaveni'
|
||||||
|
verbose_name = 'Nastavení semináře'
|
||||||
|
|
||||||
|
# aktualni_rocnik = models.ForeignKey(Rocnik, verbose_name='aktuální ročník',
|
||||||
|
# null=False, on_delete=models.PROTECT)
|
||||||
|
|
||||||
|
aktualni_cislo = models.ForeignKey(Cislo, verbose_name='Aktuální číslo',
|
||||||
|
null=False, on_delete=models.PROTECT)
|
||||||
|
|
||||||
|
cena_sous = models.IntegerField(null=False,
|
||||||
|
verbose_name="Účastnický poplatek za soustředění",
|
||||||
|
default=1000)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def aktualni_rocnik(self):
|
||||||
|
return self.aktualni_cislo.rocnik
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return 'Nastavení semináře'
|
||||||
|
|
||||||
|
def admin_url(self):
|
||||||
|
return reverse('admin:seminar_nastaveni_change', args=(self.id, ))
|
||||||
|
|
||||||
|
def verejne(self):
|
||||||
|
return False
|
|
@ -724,34 +724,3 @@ class Pohadka(SeminarModelBase):
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
# Neexistující *Node nemá smysl aktualizovat.
|
# Neexistující *Node nemá smysl aktualizovat.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@reversion.register(ignore_duplicates=True)
|
|
||||||
class Nastaveni(SingletonModel):
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
db_table = 'seminar_nastaveni'
|
|
||||||
verbose_name = 'Nastavení semináře'
|
|
||||||
|
|
||||||
# aktualni_rocnik = models.ForeignKey(Rocnik, verbose_name='aktuální ročník',
|
|
||||||
# null=False, on_delete=models.PROTECT)
|
|
||||||
|
|
||||||
aktualni_cislo = models.ForeignKey(Cislo, verbose_name='Aktuální číslo',
|
|
||||||
null=False, on_delete=models.PROTECT)
|
|
||||||
|
|
||||||
cena_sous = models.IntegerField(null=False,
|
|
||||||
verbose_name="Účastnický poplatek za soustředění",
|
|
||||||
default=1000)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def aktualni_rocnik(self):
|
|
||||||
return self.aktualni_cislo.rocnik
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return 'Nastavení semináře'
|
|
||||||
|
|
||||||
def admin_url(self):
|
|
||||||
return reverse('admin:seminar_nastaveni_change', args=(self.id, ))
|
|
||||||
|
|
||||||
def verejne(self):
|
|
||||||
return False
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import unidecode
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from korektury.testutils import create_test_pdf
|
from korektury.testutils import create_test_pdf
|
||||||
|
from models.nastaveni import *
|
||||||
from personalni.models import *
|
from personalni.models import *
|
||||||
from seminar.models.tvorba import *
|
from seminar.models.tvorba import *
|
||||||
from seminar.models.odevzdavatko import *
|
from seminar.models.odevzdavatko import *
|
||||||
|
|
|
@ -9,7 +9,8 @@ from django.db.models import Q, Sum, Count
|
||||||
from django.views.generic.base import RedirectView
|
from django.views.generic.base import RedirectView
|
||||||
from django.core.exceptions import PermissionDenied
|
from django.core.exceptions import PermissionDenied
|
||||||
|
|
||||||
from seminar.models.tvorba import Rocnik, Cislo, Nastaveni, Deadline, Problem, Tema, Clanek
|
from seminar.models.tvorba import Rocnik, Cislo, Deadline, Problem, Tema, Clanek
|
||||||
|
from seminar.models.nastaveni import Nastaveni
|
||||||
from personalni.models import Resitel, Organizator
|
from personalni.models import Resitel, Organizator
|
||||||
from seminar.models.novinky import Novinky
|
from seminar.models.novinky import Novinky
|
||||||
#from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva
|
#from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva
|
||||||
|
|
|
@ -5,7 +5,7 @@ from django.conf import settings
|
||||||
from django.contrib.staticfiles.finders import find
|
from django.contrib.staticfiles.finders import find
|
||||||
from seminar.models.soustredeni import *
|
from seminar.models.soustredeni import *
|
||||||
from personalni.models import Resitel
|
from personalni.models import Resitel
|
||||||
from seminar.models.tvorba import Nastaveni
|
from seminar.models.nastaveni import Nastaveni
|
||||||
import csv
|
import csv
|
||||||
import tempfile
|
import tempfile
|
||||||
import shutil
|
import shutil
|
||||||
|
|
Loading…
Reference in a new issue