directory.collections.directory_entry
Attributes
Classes
Provides a view on a directory's entries. |
Module Contents
- class directory.collections.directory_entry.DirectorySearchWidget[source]
Bases:
Protocol
[DirectoryEntryT
]
- class directory.collections.directory_entry.DirectoryEntryCollection(directory: onegov.directory.models.Directory, type: str = '*', keywords: Mapping[str, list[str]] | None = None, page: int = 0, search_widget: DirectorySearchWidget[DirectoryEntryT] | None = None)[source]
Bases:
onegov.core.collection.GenericCollection
[DirectoryEntryT
],onegov.core.collection.Pagination
[DirectoryEntryT
]Provides a view on a directory’s entries.
The directory itself might be a natural place for lots of these methods to reside, but ultimately we want to avoid mixing the concerns of the directory model and this view-supporting collection.
- __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.
- subset() Query[DirectoryEntryT] [source]
Returns an SQLAlchemy query containing all records that should be considered for pagination.
- 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
Pagination
base class.
- available_filters(sort_choices: bool = False, sortfunc: Callable[[str], SupportsRichComparison] | None = None) Iterable[tuple[str, str, list[str]]] [source]
Retrieve the filters with their choices.
By default the choices are returned in the same order as defined in the structrue. To filter alphabetically, set sort_choices=True.