:py:mod:`oioioi.base.main_page` =============================== .. py:module:: oioioi.base.main_page Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.base.main_page._MainPageEntry Functions ~~~~~~~~~ .. autoapisummary:: oioioi.base.main_page.register_main_page_view oioioi.base.main_page.unregister_main_page_view oioioi.base.main_page.main_page_view Attributes ~~~~~~~~~~ .. autoapisummary:: oioioi.base.main_page._main_page_registry .. py:class:: _MainPageEntry(view, condition) Bases: :py:obj:`object` .. py:data:: _main_page_registry .. py:function:: register_main_page_view(order=sys.maxsize, condition=None) Decorator for a view, which registers it as a main page. A view registered this way can be shown as the main page of the website (at URL /). If multiple views are registered, one with the lowest ``order`` for which the ``condition`` holds true is selected. :param order: value determining the order in which the main page is selected :type order: int :param condition: decides if a main page can be selected :type condition: :class:`oioioi.base.permissions.Condition` .. py:function:: unregister_main_page_view(view) Unregisters a main page view. Does nothing if not found. :param view: the main page view to unregister .. py:function:: main_page_view(request)