:py:mod:`oioioi.contests.date_registration` =========================================== .. py:module:: oioioi.contests.date_registration Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.contests.date_registration.DateRegistry Attributes ~~~~~~~~~~ .. autoapisummary:: oioioi.contests.date_registration.date_registry .. py:class:: DateRegistry Bases: :py:obj:`object` Maintains a collection of important changeable date fields. .. py:class:: DateItem(date_field, name_generator, round_chooser, qs_filter, model) Bases: :py:obj:`object` .. py:method:: register(date_field, name_generator=None, round_chooser=None, qs_filter=None, model=None, order=sys.maxsize) Registers a new date item. :param date_field: the date's field in the model :param name_generator: function taking model's object and returning the name to be displayed with the date. :param round_chooser: function taking model's object and returning the round it belongs to. :param qs_filter: function taking a (queryset, contest id) pair and returning a queryset limited to instances related to the contest. :param model: the date's model. If the model is not provided the method returns a decorator for a model. :param order: the date's order. The lower the order, the higher the priority of the date. .. py:method:: tolist(contest_id) Returns a list of items to pass to a template for rendering. .. py:data:: date_registry