oioioi.participants.controllers
¶
Module Contents¶
Classes¶
A base class for classes which should have a list of subclasses |
|
A base class for classes which should have a list of subclasses |
|
Contest controller defines whether in participants' data view email |
|
ContestController mixin that adds participants info for anonymous |
|
A base class for classes which should have a list of subclasses |
|
ContestController mixin that sets up an onsite contest. |
Functions¶
|
Attributes¶
- oioioi.participants.controllers.auditLogger¶
- class oioioi.participants.controllers.ParticipantsController(contest)[source]¶
Bases:
oioioi.contests.controllers.RegistrationController
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()
.- property form_class¶
- property participant_admin¶
- registration_template = 'participants/registration.html'¶
- 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.
- filter_participants(queryset)[source]¶
Filters the queryset of
User
to select only users which have access to the contest.
- user_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 has entered.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`.
- filter_users_with_accessible_personal_data(queryset)[source]¶
Filters the queryset of
User
to select only users whose personal data is accessible to the admins.
- no_entry_view(request)[source]¶
View rendered when a user would like to perform an action not allowed by this registration controller.
This may be a good place to put a redirection to a registration page etc.
The default implementation just raises
PermissionDenied
.
- get_model_class()[source]¶
Returns registration model class used within current registration controller.
The default implementation infers it from form_class form metadata. If there is no form_class, the default implementation returns
None
.
- class oioioi.participants.controllers.OpenParticipantsController(contest)[source]¶
Bases:
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()
.- property form_class¶
- 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`.
- class oioioi.participants.controllers.EmailShowContestControllerMixin[source]¶
Bases:
object
Contest controller defines whether in participants’ data view email should be shown. That is a case in OI-type contest.
- show_email_in_participants_data = False¶
- class oioioi.participants.controllers.AnonymousContestControllerMixin[source]¶
Bases:
object
ContestController mixin that adds participants info for anonymous contests.
- class oioioi.participants.controllers.OnsiteRegistrationController(contest)[source]¶
Bases:
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()
.- property participant_admin¶
- get_model_class()[source]¶
Returns registration model class used within current registration controller.
The default implementation infers it from form_class form metadata. If there is no form_class, the default implementation returns
None
.
- get_contest_participant_info_list(request, user)[source]¶
Returns a list of tuples (priority, info). Each entry represents a fragment of HTML with information about the user’s participation in the contest. This information will be visible for contest admins. It can be any information an application wants to add.
The fragments are sorted by priority (descending) and rendered in that order.
The default implementation returns basic info about the contestant: his/her full name, e-mail, the user id, his/her submissions and round time extensions.
To add additional info from another application, override this method. For integrity, include the result of the parent implementation in your output.