oioioi.contests.forms
¶
Module Contents¶
Classes¶
The main implementation of all the Form logic. Note that this class is |
|
The main implementation of all the Form logic. Note that this class is |
|
Represents base submission form containing task selector. |
|
Represents base submission form containing task selector. |
|
A collection of Fields, plus their associated data. |
|
A collection of Fields, plus their associated data. |
- class oioioi.contests.forms.SimpleContestForm(*args, **kwargs)[source]¶
Bases:
django.forms.ModelForm
The main implementation of all the Form logic. Note that this class is different than Form. See the comments by the Form class for more info. Any improvements to the form API should be made to this class, not to the Form class.
- class oioioi.contests.forms.ProblemInstanceForm(*args, **kwargs)[source]¶
Bases:
django.forms.ModelForm
The main implementation of all the Form logic. Note that this class is different than Form. See the comments by the Form class for more info. Any improvements to the form API should be made to this class, not to the Form class.
- class oioioi.contests.forms.SubmissionForm(request, *args, **kwargs)[source]¶
Bases:
django.forms.Form
Represents base submission form containing task selector.
- Recognized optional
**kwargs
fields: problem_filter
Function filtering submittable tasks.kind
Kind of submission accessible withkind
property.problem_instance
When SubmissionForm is used only for oneproblem_instance. Otherwise
problem_instance
is None.
add_kind_and_user_fields
Option deciding whether form shouldadd kind and user fields to itself.
- set_custom_field_attributes(field_name, problem_instance)[source]¶
Prepare custom field to be displayed only for a specific problems. Still all custom fields need to have unique names (best practice is to prefix them with problem_instance.id). :param field_name: Name of custom field :param problem_instance: Problem instance which they are assigned to
- hide_default_fields(problem_instance)[source]¶
Hide default form fields for a given problem instance. :param problem_instance: Problem instance which will have fields hidden
- clean(check_submission_limit=True, check_round_times=True)[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- Recognized optional
- class oioioi.contests.forms.SubmissionFormForProblemInstance(request, problem_instance, *args, **kwargs)[source]¶
Bases:
SubmissionForm
Represents base submission form containing task selector.
- Recognized optional
**kwargs
fields: problem_filter
Function filtering submittable tasks.kind
Kind of submission accessible withkind
property.problem_instance
When SubmissionForm is used only for oneproblem_instance. Otherwise
problem_instance
is None.
add_kind_and_user_fields
Option deciding whether form shouldadd kind and user fields to itself.
- Recognized optional