directory.collections.directory_entry

Attributes

T

DirectoryEntryT

Classes

DirectorySearchWidget

DirectoryEntryCollection

Provides a view on a directory's entries.

Module Contents

directory.collections.directory_entry.T[source]
directory.collections.directory_entry.DirectoryEntryT[source]
class directory.collections.directory_entry.DirectorySearchWidget[source]

Bases: Protocol[DirectoryEntryT]

property name: str[source]
property search_query: Query[DirectoryEntryT][source]
adapt(query: Query[DirectoryEntryT]) Query[DirectoryEntryT][source]
html(layout: Any) markupsafe.Markup[source]
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.

type = '*'[source]
directory[source]
keywords[source]
page = 0[source]
search_widget = None[source]
__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.

property search: str | None[source]
property search_query: Query[DirectoryEntryT] | None[source]
property page_index: int[source]

Returns the current page index (starting at 0).

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.

by_name(name: str) DirectoryEntryT | None[source]
query() Query[DirectoryEntryT][source]
valid_keywords(parameters: Mapping[str, T]) dict[str, T][source]
property directory_name: str[source]
property model_class: type[DirectoryEntryT][source]
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.

for_keywords(singular: bool = False, **keywords: list[str]) Self[source]
for_toggled_keyword_value(keyword: str, value: str, singular: bool = False) Self[source]
without_keywords() Self[source]