oioioi.contests.date_registration
¶
Module Contents¶
Classes¶
Maintains a collection of important changeable date fields. |
Attributes¶
- class oioioi.contests.date_registration.DateRegistry[source]¶
Bases:
object
Maintains a collection of important changeable date fields.
- register(date_field, name_generator=None, round_chooser=None, qs_filter=None, model=None, order=sys.maxsize)[source]¶
Registers a new date item.
- Parameters
date_field – the date’s field in the model
name_generator – function taking model’s object and returning the name to be displayed with the date.
round_chooser – function taking model’s object and returning the round it belongs to.
qs_filter – function taking a (queryset, contest id) pair and returning a queryset limited to instances related to the contest.
model – the date’s model. If the model is not provided the method returns a decorator for a model.
order – the date’s order. The lower the order, the higher the priority of the date.