|
|
|
from django import forms
|
|
|
|
from dal import autocomplete
|
|
|
|
from .models import Skola
|
|
|
|
|
|
|
|
from seminar.models import Resitel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PrihlaskaForm(forms.Form):
|
|
|
|
jmeno = forms.CharField(label='Jméno', max_length=256, required=True)
|
|
|
|
prijmeni = forms.CharField(label='Příjmení', max_length=256, required=True)
|
|
|
|
username = forms.CharField(label='Přihlašovací jméno', max_length=256, required=True)
|
|
|
|
# TODO heslo?
|
|
|
|
pohlavi_muz = forms.ChoiceField(label='Pohlaví',
|
|
|
|
choices = ((True,'muž'),(False,'žena')), required=True)
|
|
|
|
email = forms.EmailField(label='E-mail',max_length=256, required=True)
|
|
|
|
telefon = forms.CharField(label='Telefon',max_length=256, required=False)
|
|
|
|
datum_narozeni = forms.DateField(label='Datum narození', required=False)
|
|
|
|
ulice = forms.CharField(label='Ulice', max_length=256, required=False)
|
|
|
|
mesto = forms.CharField(label='Město', max_length=256, required=False)
|
|
|
|
psc = forms.CharField(label='PSČ', max_length=32, required=False)
|
|
|
|
stat = forms.ChoiceField(label='Stát',
|
|
|
|
choices = (('CZ', 'Česká Republika'),
|
|
|
|
('SK', 'Slovenská Republika'),
|
|
|
|
('other', 'Jiné')),
|
|
|
|
required=False)
|
|
|
|
|
|
|
|
skola = forms.ModelChoiceField(
|
|
|
|
queryset=Skola.objects.all(),
|
|
|
|
widget=autocomplete.ModelSelect2(url='autocomplete_skola')
|
|
|
|
)
|
|
|
|
|
|
|
|
# skola_stat_select = forms.ChoiceField(label='Stát',
|
|
|
|
# choices = (('cz', 'Česká Republika'),
|
|
|
|
# ('sk', 'Slovenská Republika'),
|
|
|
|
# ('other', 'Jiné')),
|
|
|
|
# required=True)
|
|
|
|
# kraj_select = forms.ChoiceField(label='Kraj',required=True)
|
|
|
|
# skola_select = forms.ChoiceField(label='Škola',required=True)
|
|
|
|
#kraj
|
|
|
|
#škola
|
|
|
|
# trida = forms.CharField(label='Třída',max_length=10, required=True)
|
|
|
|
#název školy
|
|
|
|
#adresa školy
|
|
|
|
# skola_nazev = forms.CharField(label='Název školy', max_length=256, required=False)
|
|
|
|
# skola_adresa = forms.CharField(label='Adresa školy', max_length=256, required=False)
|
|
|
|
|
|
|
|
rok_maturity = forms.IntegerField(label='Rok maturity', min_value=2019, required=True)
|
|
|
|
zasilat = forms.ChoiceField(label='Kam zasílat čísla a řešení',choices = Resitel.ZASILAT_CHOICES, required=True)
|
|
|
|
gdpr = forms.BooleanField(label='Souhlasím se zpracováním osobních údajů', required=True)
|
|
|
|
spam = forms.BooleanField(label='Souhlasím se zasíláním materiálů od MFF UK', required=False)
|
|
|
|
|
|
|
|
|