translator_directory.collections.language ========================================= .. py:module:: translator_directory.collections.language Classes ------- .. autoapisummary:: translator_directory.collections.language.LanguageCollection Module Contents --------------- .. py:class:: LanguageCollection(session: sqlalchemy.orm.Session, page: int = 0, letter: str | None = None) Bases: :py:obj:`onegov.core.collection.GenericCollection`\ [\ :py:obj:`onegov.translator_directory.models.language.Language`\ , :py:obj:`uuid.UUID`\ ], :py:obj:`onegov.core.collection.Pagination`\ [\ :py:obj:`onegov.translator_directory.models.language.Language`\ ] Provides collections with pagination, if they implement a few documented properties and methods. See :class:`onegov.ticket.TicketCollection` for an example. .. py:attribute:: batch_size :value: 20 .. py:attribute:: page :value: 0 .. py:attribute:: letter .. py:property:: model_class :type: type[onegov.translator_directory.models.language.Language] .. py:method:: query() -> sqlalchemy.orm.Query[onegov.translator_directory.models.language.Language] .. py:method:: __eq__(other: object) -> bool Returns True if the current and the other Pagination instance are equal. Used to find the current page in a list of pages. .. py:method:: subset() -> sqlalchemy.orm.Query[onegov.translator_directory.models.language.Language] Returns an SQLAlchemy query containing all records that should be considered for pagination. .. py:property:: page_index :type: int The current page index (starting at 0). .. py:method:: page_by_index(index: int) -> Self Returns the page at the given index. A page here means an instance of the class inheriting from the ``Pagination`` base class. .. py:property:: used_letters :type: list[str] All distinct first letters of the languages' names. .. py:method:: by_letter(letter: str | None) -> Self