AKSubmission.forms module
Submission-specific forms
- AKSubmission.forms.clean_slot_duration(raw_duration, event)[source]
Clean/convert user input for the duration of a slot
Handle different duration formats (h:mm and decimal comma instead of point), clamp durations longer than the event to the event length (see
AKModel.models.Event.max_slot_duration), round to the precision ofAKModel.models.AKSlot.durationand check the result against the validators of that field- Parameters:
raw_duration – raw input, either with “:”, “,” or “.”
event – event the slot will belong to
- Returns:
tuple of the normalized duration (in hours) and a flag whether the duration had to be clamped
- Return type:
(Decimal, bool)
- Raises:
ValidationError – if the input cannot be converted into a meaningful duration
- class AKSubmission.forms.AKForm(*args, **kwargs)[source]
Bases:
AvailabilitiesFormMixin,ModelFormBase form to add and edit AKs
Contains suitable widgets for the different data types, restricts querysets (e.g., of requirements) to entries belonging to the event this AK belongs to. Prepares initial slot creation (by accepting multiple input formats and a list of slots to generate), automatically generate short names and wiki links if necessary
Will be modified/used by
AKSubmissionForm(that allows to add slots and excludes links) andAKWishFormForm fields:
name: Name (CharField)short_name: Short Name (CharField)protocol_link: Protocol Link (URLField)owners: Owners (ModelMultipleChoiceField)description: Brief Description (CharField)goal: Design/Goal (CharField)info: Further Information (CharField)results: Results (CharField)category: Category (ModelChoiceField)types: Types (ModelMultipleChoiceField)reso: Resolution Intention (BooleanField)present: Present this AK (NullBooleanField)requirements: Requirements (ModelMultipleChoiceField)conflicts: Conflicting AKs (ModelMultipleChoiceField)prerequisites: Prerequisite AKs (ModelMultipleChoiceField)notes: Organizational Notes (CharField)event: Event (ModelChoiceField)availabilities: Availability (CharField)
- class AKSubmission.forms.AKSubmissionForm(*args, **kwargs)[source]
Bases:
AKFormForm for Submitting new AKs
Is a special variant of
AKFormthat does not allow to manually edit wiki links or enter results (which only exist after the AK took place) and enforces the generation of at least one slot.Form fields:
name: Name (CharField)short_name: Short Name (CharField)protocol_link: Protocol Link (URLField)owners: Owners (ModelMultipleChoiceField)description: Brief Description (CharField)goal: Design/Goal (CharField)info: Further Information (CharField)category: Category (ModelChoiceField)types: Types (ModelMultipleChoiceField)reso: Resolution Intention (BooleanField)present: Present this AK (NullBooleanField)requirements: Requirements (ModelMultipleChoiceField)conflicts: Conflicting AKs (ModelMultipleChoiceField)prerequisites: Prerequisite AKs (ModelMultipleChoiceField)notes: Organizational Notes (CharField)event: Event (ModelChoiceField)availabilities: Availability (CharField)
- class AKSubmission.forms.AKWishForm(*args, **kwargs)[source]
Bases:
AKFormForm for submitting or editing wishes
Is a special variant of
AKFormthat does not allow to specify owner(s) or manually edit wiki and protocol links or enter resultsForm fields:
name: Name (CharField)short_name: Short Name (CharField)description: Brief Description (CharField)goal: Design/Goal (CharField)info: Further Information (CharField)category: Category (ModelChoiceField)types: Types (ModelMultipleChoiceField)reso: Resolution Intention (BooleanField)present: Present this AK (NullBooleanField)requirements: Requirements (ModelMultipleChoiceField)conflicts: Conflicting AKs (ModelMultipleChoiceField)prerequisites: Prerequisite AKs (ModelMultipleChoiceField)notes: Organizational Notes (CharField)event: Event (ModelChoiceField)availabilities: Availability (CharField)
- class AKSubmission.forms.AKOwnerForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]
Bases:
ModelFormForm to create/edit AK owners
Form fields:
name: Nickname (CharField)institution: Institution (CharField)link: Web Link (URLField)event: Event (ModelChoiceField)
- class AKSubmission.forms.AKDurationForm(*args, **kwargs)[source]
Bases:
ModelFormForm to add an additional slot to a given AK
Accepts the same duration formats as
AKSubmissionFormand clamps durations longer than the event to the event length (seeclean_slot_duration())Form fields:
duration: Duration (CharField)ak: AK (ModelChoiceField)event: Event (ModelChoiceField)
- clean()[source]
Normalize/clean duration input (see
clean_slot_duration())- Returns:
cleaned inputs
- class AKSubmission.forms.AKOrgaMessageForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]
Bases:
ModelFormForm to create a confidential message to the organizers belonging to a given AK
Form fields:
ak: AK (ModelChoiceField)text: Message text (CharField)event: Event (ModelChoiceField)