:py:mod:`oioioi.problems.forms` =============================== .. py:module:: oioioi.problems.forms Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.problems.forms.ProblemUploadForm oioioi.problems.forms.PackageUploadForm oioioi.problems.forms.ProblemStatementConfigForm oioioi.problems.forms.RankingVisibilityConfigForm oioioi.problems.forms.RegistrationAvailabilityConfigForm oioioi.problems.forms.ProblemSiteForm oioioi.problems.forms.ProblemsetSourceForm oioioi.problems.forms.ProblemStatementReplaceForm oioioi.problems.forms.PackageFileReuploadForm oioioi.problems.forms.ProblemNameInlineFormSet oioioi.problems.forms.LocalizationFormset oioioi.problems.forms.OriginInfoValueForm oioioi.problems.forms.OriginTagThroughForm oioioi.problems.forms.OriginInfoValueThroughForm oioioi.problems.forms.DifficultyTagThroughForm oioioi.problems.forms.AlgorithmTagThroughForm Functions ~~~~~~~~~ .. autoapisummary:: oioioi.problems.forms._localized_formset_get_initial oioioi.problems.forms._label_from_instance .. py:class:: ProblemUploadForm(contest, existing_problem, *args, **kwargs) Bases: :py:obj:`django.forms.Form` A collection of Fields, plus their associated data. .. py:attribute:: contest_id .. py:method:: clean() 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__'. .. py:class:: PackageUploadForm(contest, existing_problem, *args, **kwargs) Bases: :py:obj:`ProblemUploadForm` A collection of Fields, plus their associated data. .. py:attribute:: package_file .. py:class:: ProblemStatementConfigForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: fields :annotation: = __all__ .. py:attribute:: model .. py:attribute:: widgets .. py:class:: RankingVisibilityConfigForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: fields :annotation: = __all__ .. py:attribute:: model .. py:attribute:: widgets .. py:class:: RegistrationAvailabilityConfigForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: fields :annotation: = __all__ .. py:attribute:: model .. py:attribute:: widgets .. py:class:: ProblemSiteForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: fields :annotation: = ['url_key'] .. py:attribute:: model .. py:attribute:: widgets .. py:class:: ProblemsetSourceForm(url_key, *args, **kwargs) Bases: :py:obj:`django.forms.Form` A collection of Fields, plus their associated data. .. py:attribute:: url_key .. py:class:: ProblemStatementReplaceForm(file_names, *args, **kwargs) Bases: :py:obj:`django.forms.Form` A collection of Fields, plus their associated data. .. py:attribute:: file_name .. py:attribute:: file_replacement .. py:method:: _set_field_show_always(field_name) .. py:class:: PackageFileReuploadForm(file_names, *args, **kwargs) Bases: :py:obj:`django.forms.Form` A collection of Fields, plus their associated data. .. py:attribute:: file_name .. py:attribute:: file_replacement .. py:method:: _set_field_show_always(field_name) .. py:function:: _localized_formset_get_initial(localized_objects) .. py:class:: ProblemNameInlineFormSet(*args, **kwargs) Bases: :py:obj:`django.forms.models.BaseInlineFormSet` A formset for child objects related to a parent. .. py:class:: LocalizationFormset(*args, **kwargs) Bases: :py:obj:`django.forms.models.BaseInlineFormSet` A formset for child objects related to a parent. .. py:class:: OriginInfoValueForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: model .. py:attribute:: fields :annotation: = ['category', 'value', 'order', 'problems'] .. py:attribute:: exclude :annotation: = ['parent_tag'] .. py:method:: save(commit=True) Save this form's self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance. .. py:function:: _label_from_instance(obj) .. py:class:: OriginTagThroughForm(*args, **kwargs) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: labels .. py:attribute:: help_texts .. py:class:: OriginInfoValueThroughForm(*args, **kwargs) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: labels .. py:attribute:: help_texts .. py:class:: DifficultyTagThroughForm(*args, **kwargs) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: labels .. py:attribute:: help_texts .. py:class:: AlgorithmTagThroughForm(*args, **kwargs) Bases: :py:obj:`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. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: labels .. py:attribute:: help_texts