:py:mod:`oioioi.contests.models` ================================ .. py:module:: oioioi.contests.models Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.contests.models.Contest oioioi.contests.models.ContestAttachment oioioi.contests.models.Round oioioi.contests.models.ProblemStatementConfig oioioi.contests.models.RankingVisibilityConfig oioioi.contests.models.RegistrationAvailabilityConfig oioioi.contests.models.ProblemInstance oioioi.contests.models.Submission oioioi.contests.models.SubmissionReport oioioi.contests.models.ScoreReport oioioi.contests.models.FailureReport oioioi.contests.models.UserResultForProblem oioioi.contests.models.UserResultForRound oioioi.contests.models.UserResultForContest oioioi.contests.models.RoundTimeExtension oioioi.contests.models.ContestPermission oioioi.contests.models.ContestView oioioi.contests.models.ContestLink Functions ~~~~~~~~~ .. autoapisummary:: oioioi.contests.models.make_contest_filename oioioi.contests.models._generate_contest_id oioioi.contests.models._call_controller_adjust_contest oioioi.contests.models._round_end_date_name_generator oioioi.contests.models._generate_round_id oioioi.contests.models._generate_problem_instance_fields oioioi.contests.models.contest_links_generator Attributes ~~~~~~~~~~ .. autoapisummary:: oioioi.contests.models.statements_visibility_options oioioi.contests.models.ranking_visibility_options oioioi.contests.models.registration_availability_options oioioi.contests.models.submission_kinds oioioi.contests.models.submission_statuses oioioi.contests.models.submission_report_kinds oioioi.contests.models.submission_report_statuses oioioi.contests.models.contest_permissions .. py:function:: make_contest_filename(instance, filename) .. py:class:: Contest(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: get_latest_by :annotation: = creation_date .. py:attribute:: permissions :annotation: = [None, None, None, None] .. py:property:: controller .. py:attribute:: id .. py:attribute:: name .. py:attribute:: controller_name .. py:attribute:: creation_date .. py:attribute:: default_submissions_limit .. py:attribute:: contact_email .. py:attribute:: judging_priority .. py:attribute:: judging_weight .. py:attribute:: enable_editor .. py:method:: save(*args, **kwargs) Save the current instance. Override this in a subclass if you want to control the saving process. The 'force_insert' and 'force_update' parameters can be used to insist that the "save" must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set. .. py:method:: __str__() Return str(self). .. py:function:: _generate_contest_id(sender, instance, raw, **kwargs) Automatically generate a contest ID if not provided, by trying ``p0``, ``p1``, etc. .. py:function:: _call_controller_adjust_contest(sender, instance, raw, **kwargs) .. py:class:: ContestAttachment(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Represents an additional file visible to the contestant, linked to the contest or to the round. This may be used for additional materials, like rules, documentation etc. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:property:: filename .. py:property:: download_name .. py:attribute:: contest .. py:attribute:: description .. py:attribute:: content .. py:attribute:: round .. py:attribute:: pub_date .. py:method:: __str__() Return str(self). .. py:function:: _round_end_date_name_generator(obj) .. py:class:: Round(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: unique_together :annotation: = ['contest', 'name'] .. py:attribute:: ordering :annotation: = ['contest', 'start_date'] .. py:attribute:: contest .. py:attribute:: name .. py:attribute:: start_date .. py:attribute:: end_date .. py:attribute:: results_date .. py:attribute:: public_results_date .. py:attribute:: is_trial .. py:method:: __str__() Return str(self). .. py:method:: clean() Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS. .. py:function:: _generate_round_id(sender, instance, raw, **kwargs) Automatically generate a round name if not provided. .. py:data:: statements_visibility_options .. py:class:: ProblemStatementConfig(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: contest .. py:attribute:: visible .. py:data:: ranking_visibility_options .. py:class:: RankingVisibilityConfig(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: contest .. py:attribute:: visible .. py:data:: registration_availability_options .. py:class:: RegistrationAvailabilityConfig(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: contest .. py:attribute:: enabled .. py:attribute:: registration_available_from .. py:attribute:: registration_available_to .. py:method:: is_registration_open(timestamp) .. py:method:: clean() Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS. .. py:class:: ProblemInstance(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: unique_together :annotation: = ['contest', 'short_name'] .. py:attribute:: ordering :annotation: = ['round', 'short_name'] .. py:property:: controller .. py:attribute:: contest .. py:attribute:: round .. py:attribute:: problem .. py:attribute:: short_name .. py:attribute:: submissions_limit .. py:attribute:: needs_rejudge .. py:method:: get_short_name_display() .. py:method:: __str__() Return str(self). .. py:function:: _generate_problem_instance_fields(sender, instance, raw, **kwargs) .. py:data:: submission_kinds .. py:data:: submission_statuses .. py:class:: Submission(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: get_latest_by :annotation: = date .. py:property:: problem .. py:attribute:: problem_instance .. py:attribute:: user .. py:attribute:: date .. py:attribute:: kind .. py:attribute:: score .. py:attribute:: status .. py:attribute:: comment .. py:method:: is_scored() .. py:method:: get_date_display(shortened=False) .. py:method:: get_date_display_shortened() .. py:method:: get_score_display() .. py:method:: __str__() Return str(self). .. py:data:: submission_report_kinds .. py:data:: submission_report_statuses .. py:class:: SubmissionReport(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: get_latest_by :annotation: = creation_date .. py:attribute:: ordering :annotation: = ['-creation_date'] .. py:attribute:: index_together :annotation: = [['submission', 'creation_date']] .. py:property:: score_report .. py:attribute:: submission .. py:attribute:: creation_date .. py:attribute:: kind .. py:attribute:: status .. py:class:: ScoreReport(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:attribute:: submission_report .. py:attribute:: status .. py:attribute:: score .. py:attribute:: max_score .. py:attribute:: comment .. py:method:: get_score_display() .. py:class:: FailureReport(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` A report generated when evaluation process failed. The submission should have its status set to ``FAILED``. Such reports are not shown to users. .. py:attribute:: submission_report .. py:attribute:: message .. py:attribute:: json_environ .. py:class:: UserResultForProblem(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` User result (score) for the problem. Each user can have only one class:`UserResultForProblem` per problem instance. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: unique_together :annotation: = ['user', 'problem_instance'] .. py:attribute:: user .. py:attribute:: problem_instance .. py:attribute:: score .. py:attribute:: status .. py:attribute:: submission_report .. py:class:: UserResultForRound(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` User result (score) for the round. Each user can have only one :class:`UserResultForRound` per round. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: unique_together :annotation: = ['user', 'round'] .. py:attribute:: user .. py:attribute:: round .. py:attribute:: score .. py:class:: UserResultForContest(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Represents the user result (score) for the contest. Each user can have only one :class:`UserResultForContest` per contest for given type. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: unique_together :annotation: = ['user', 'contest'] .. py:attribute:: user .. py:attribute:: contest .. py:attribute:: score .. py:class:: RoundTimeExtension(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Represents the time the round has been extended by for a certain user. The extra time is given in minutes. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: unique_together :annotation: = ['user', 'round'] .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: user .. py:attribute:: round .. py:attribute:: extra_time .. py:method:: __str__() Return str(self). .. py:data:: contest_permissions .. py:class:: ContestPermission(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: unique_together :annotation: = ['user', 'contest', 'permission'] .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: user .. py:attribute:: contest .. py:attribute:: permission .. py:method:: __str__() Return str(self). .. py:class:: ContestView(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: unique_together :annotation: = ['user', 'contest'] .. py:attribute:: index_together :annotation: = [['user', 'timestamp']] .. py:attribute:: get_latest_by :annotation: = timestamp .. py:attribute:: ordering :annotation: = ['-timestamp'] .. py:attribute:: user .. py:attribute:: contest .. py:attribute:: timestamp .. py:method:: __str__() Return str(self). .. py:class:: ContestLink(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: verbose_name .. py:attribute:: verbose_name_plural .. py:attribute:: contest .. py:attribute:: description .. py:attribute:: url .. py:attribute:: order .. py:function:: contest_links_generator(request)