oioioi.mp.controllers
¶
Module Contents¶
Classes¶
A base class for classes which should have a list of subclasses |
|
Contains the contest logic and rules. |
|
Changes to Default Ranking: |
Attributes¶
- class oioioi.mp.controllers.MPRegistrationController(contest)[source]¶
Bases:
oioioi.participants.controllers.ParticipantsController
A base class for classes which should have a list of subclasses available.
The list of subclasses is available in their
subclasses
class attributes. Classes which have explicitly setabstract
class attribute toTrue
are not added tosubclasses
.If a class has
modules_with_subclasses
attribute (list or string), then specified modules for all installed applications can be loaded by callingload_subclasses()
.- classmethod anonymous_can_enter_contest()[source]¶
Determines if an anonymous user can enter the contest.
Allowed anonymous users will have limited functionality, but they can see the problems, review questions etc. Modules should give them as much functionality as reasonably possible.
- Return type
bool
- allow_login_as_public_name()[source]¶
Determines if participants may choose to stay anonymous, i.e. use their logins as public names.
- can_enter_contest(request)[source]¶
Determines if the current user is allowed to enter the contest, i.e. see any page related to the contest.
The default implementation uses
filter_visible_contests()
with a single-element contest queryset.- Return type
bool
- visible_contests_query(request)[source]¶
Provides a
django.db.models.Q
expression which can be used onoioioi.contests.models.Contest
queryset already limited to contests using this controller to filter for contests the user can enter.It must not make use of attribute contest of the controller, as it is not guaranteed to be set. It is called with None contest in :function:`oioioi.contests.utils.visible_contests`.
- mixins_for_admin()[source]¶
Returns an iterable of mixins to add to the default
oioioi.contests.admin.ContestAdmin
for the contest.The default implementation returns an empty tuple.
- class oioioi.mp.controllers.MPContestController(contest)[source]¶
Bases:
oioioi.programs.controllers.ProgrammingContestController
Contains the contest logic and rules.
This is the computerized implementation of the contest’s official rules.
- class oioioi.mp.controllers.MPRankingController(contest)[source]¶
Bases:
oioioi.rankings.controllers.DefaultRankingController
Changes to Default Ranking: 1. Sum column is just after User column 2. Rounds with earlier start_date are more to the left