Skip to content
Snippets Groups Projects
Commit 6ea3aabb authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Move AKAddSlotForm from AKSubmission to AKScheduling

I think, that makes sense since it is supposed to be used by the graphical scheduling view
parent 7cf8fc1d
No related branches found
No related tags found
No related merge requests found
from django import forms from django import forms
from django.utils.translation import gettext_lazy as _
from AKModel.models import AK from AKModel.models import AK
...@@ -11,3 +12,17 @@ class AKInterestForm(forms.ModelForm): ...@@ -11,3 +12,17 @@ class AKInterestForm(forms.ModelForm):
fields = ['interest', fields = ['interest',
'notes', 'notes',
] ]
class AKAddSlotForm(forms.Form):
"""
Form to create a new slot for an existing AK directly from scheduling view
"""
start = forms.CharField(label=_("Start"), disabled=True)
end = forms.CharField(label=_("End"), disabled=True)
duration = forms.CharField(label=_("Duration"), disabled=True)
room = forms.IntegerField(label=_("Room"), disabled=True)
def __init__(self, event):
super().__init__()
self.fields['ak'] = forms.ModelChoiceField(event.ak_set.all(), label=_("AK"))
...@@ -7,8 +7,7 @@ from django.views.generic import ListView, DetailView, UpdateView ...@@ -7,8 +7,7 @@ from django.views.generic import ListView, DetailView, UpdateView
from AKModel.models import AKSlot, AKTrack, Event, AK, AKCategory from AKModel.models import AKSlot, AKTrack, Event, AK, AKCategory
from AKModel.metaviews.admin import EventSlugMixin, FilterByEventSlugMixin, AdminViewMixin, IntermediateAdminView from AKModel.metaviews.admin import EventSlugMixin, FilterByEventSlugMixin, AdminViewMixin, IntermediateAdminView
from AKScheduling.forms import AKInterestForm from AKScheduling.forms import AKInterestForm, AKAddSlotForm
from AKSubmission.forms import AKAddSlotForm
class UnscheduledSlotsAdminView(AdminViewMixin, FilterByEventSlugMixin, ListView): class UnscheduledSlotsAdminView(AdminViewMixin, FilterByEventSlugMixin, ListView):
......
...@@ -164,14 +164,3 @@ class AKOrgaMessageForm(forms.ModelForm): ...@@ -164,14 +164,3 @@ class AKOrgaMessageForm(forms.ModelForm):
'event': forms.HiddenInput, 'event': forms.HiddenInput,
'text': forms.Textarea, 'text': forms.Textarea,
} }
class AKAddSlotForm(forms.Form):
start = forms.CharField(label=_("Start"), disabled=True)
end = forms.CharField(label=_("End"), disabled=True)
duration = forms.CharField(label=_("Duration"), disabled=True)
room = forms.IntegerField(label=_("Room"), disabled=True)
def __init__(self, event):
super().__init__()
self.fields['ak'] = forms.ModelChoiceField(event.ak_set.all(), label=_("AK"))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment