Browse Source

seminar | submitovatko | prejmenovana trida, odebrany nadbytecne polozky formulare

middleware_test
Tomas "Jethro" Pokorny 5 years ago
committed by Pavel 'LEdoian' Turinsky
parent
commit
c11ca22548
  1. 2
      seminar/forms.py
  2. 2
      seminar/urls.py
  3. 2
      seminar/views/views_all.py

2
seminar/forms.py

@ -257,6 +257,7 @@ class NahrajReseniForm(forms.ModelForm):
class Meta: class Meta:
model = m.Reseni model = m.Reseni
fields = ('problem',) fields = ('problem',)
help_texts = {'problem':''} # Nezobrazovat help text ve formuláři
widgets = {'problem': widgets = {'problem':
autocomplete.ModelSelect2Multiple( autocomplete.ModelSelect2Multiple(
@ -272,6 +273,7 @@ ReseniSPrilohamiFormSet = inlineformset_factory(m.Reseni,m.PrilohaReseni,
fields = ('soubor','res_poznamka'), fields = ('soubor','res_poznamka'),
widgets = {'res_poznamka':forms.TextInput()}, widgets = {'res_poznamka':forms.TextInput()},
extra = 1, extra = 1,
can_delete = False,
) )

2
seminar/urls.py

@ -118,7 +118,7 @@ urlpatterns = [
path('autocomplete/problem/odevzdatelny',views.OdevzdatelnyProblemAutocomplete.as_view(), name='autocomplete_problem_odevzdatelny'), path('autocomplete/problem/odevzdatelny',views.OdevzdatelnyProblemAutocomplete.as_view(), name='autocomplete_problem_odevzdatelny'),
path('temp/add_solution', views.AddSolutionView.as_view(),name='seminar_vloz_reseni'), path('temp/add_solution', views.AddSolutionView.as_view(),name='seminar_vloz_reseni'),
path('temp/submit_solution', views.SubmitSolutionView.as_view(),name='seminar_nahraj_reseni'), path('temp/nahraj_reseni', views.NahrajReseniView.as_view(),name='seminar_nahraj_reseni'),
path('', views.TitulniStranaView.as_view(), name='titulni_strana'), path('', views.TitulniStranaView.as_view(), name='titulni_strana'),

2
seminar/views/views_all.py

@ -1212,7 +1212,7 @@ class AddSolutionView(LoginRequiredMixin, FormView):
form_class = f.VlozReseniForm form_class = f.VlozReseniForm
success_url = '/' success_url = '/'
class SubmitSolutionView(LoginRequiredMixin, CreateView): class NahrajReseniView(LoginRequiredMixin, CreateView):
model = s.Reseni model = s.Reseni
template_name = 'seminar/nahraj_reseni.html' template_name = 'seminar/nahraj_reseni.html'
form_class = f.NahrajReseniForm form_class = f.NahrajReseniForm

Loading…
Cancel
Save