translator_directory.collections.translator
Attributes
Classes
Provides collections with pagination, if they implement a few |
Module Contents
- class translator_directory.collections.translator.TranslatorCollection(app: onegov.translator_directory.app.TranslatorDirectoryApp, page: int = 0, written_langs: list[str] | None = None, spoken_langs: list[str] | None = None, monitor_langs: list[str] | None = None, order_by: str | None = None, order_desc: bool = False, user_role: str | None = None, search: str | None = None, guilds: list[str] | None = None, interpret_types: list[str] | None = None, state: str | None = 'published', admissions: list[str] | None = None, genders: list[str] | None = None, include_hidden: bool = False, show_all_including_hidden: bool = False)[source]
Bases:
onegov.core.collection.GenericCollection[onegov.translator_directory.models.translator.Translator],onegov.core.collection.Pagination[onegov.translator_directory.models.translator.Translator]Provides collections with pagination, if they implement a few documented properties and methods.
See
onegov.ticket.TicketCollectionfor an example.- __eq__(other: object) bool[source]
Returns True if the current and the other Pagination instance are equal. Used to find the current page in a list of pages.
- add(update_user: bool = True, **kwargs: Any) onegov.translator_directory.models.translator.Translator[source]
- update_user(item: onegov.translator_directory.models.translator.Translator, new_email: str | None) None[source]
Keep the translator and its user account in sync.
Creates a new user account if an email address is set (if not already existing).
Disable user accounts if an email has been deleted.
Change usernames if an email has changed.
Make sure used user accounts have the right role.
Make sure used user accounts are activated.
Make sure the password is changed if activated or disabled.
- subset() sqlalchemy.orm.Query[onegov.translator_directory.models.translator.Translator][source]
Returns an SQLAlchemy query containing all records that should be considered for pagination.
- property by_spoken_lang_expression: tuple[sqlalchemy.sql.elements.ColumnElement[bool], Ellipsis][source]
- property by_written_lang_expression: tuple[sqlalchemy.sql.elements.ColumnElement[bool], Ellipsis][source]
- property by_monitor_lang_expression: tuple[sqlalchemy.sql.elements.ColumnElement[bool], Ellipsis][source]
- property by_search_term_expression: tuple[sqlalchemy.sql.elements.ColumnElement[bool], Ellipsis][source]
Search for any word in any field of the search columns
- property by_professional_guilds_expression: tuple[sqlalchemy.sql.elements.ColumnElement[bool], Ellipsis][source]
- property by_interpreting_types_expression: tuple[sqlalchemy.sql.elements.ColumnElement[bool], Ellipsis][source]
- page_by_index(index: int) Self[source]
Returns the page at the given index. A page here means an instance of the class inheriting from the
Paginationbase class.