directory.models.directory
Attributes
Classes
Create a collection of name/value pairs.  | 
|
A general file (image, document, pdf, etc), referenced in the database.  | 
|
A directory of entries that share a common data structure. For example,  | 
|
Represents a single recipient.  | 
|
Adds subscription management to a recipient.  | 
Module Contents
- class directory.models.directory._Sentinel(*args, **kwds)[source]
 Bases:
enum.EnumCreate a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- class directory.models.directory.DirectoryFile[source]
 Bases:
onegov.file.FileA general file (image, document, pdf, etc), referenced in the database.
Thanks to the use of Depot files can be seemingly stored in the database (with transaction guarantees), without actually storing it in the database.
- linked_directory_entries: sqlalchemy.orm.relationship[list[directory.models.directory_entry.DirectoryEntry]][source]
 
- property directory_entry: directory.models.directory_entry.DirectoryEntry | None[source]
 
- class directory.models.directory.Directory[source]
 Bases:
onegov.core.orm.Base,onegov.core.orm.mixins.ContentMixin,onegov.core.orm.mixins.TimestampMixin,onegov.search.SearchableContent,onegov.file.MultiAssociatedFilesA directory of entries that share a common data structure. For example, a directory of people, of emergency services or playgrounds.
- property fts_public: bool[source]
 Returns True if the model is available to be found by the public. If false, only editors/admins will see this object in the search results.
- entries: sqlalchemy.orm.relationship[list[directory.models.directory_entry.DirectoryEntry]][source]
 
- property entry_cls: type[directory.models.directory_entry.DirectoryEntry][source]
 
- add(values: dict[str, Any], type: str | InheritType = INHERIT) directory.models.directory_entry.DirectoryEntry[source]
 
- add_by_form(form: DirectoryEntryForm, type: str | InheritType = INHERIT) directory.models.directory_entry.DirectoryEntry[source]
 
- update(entry: directory.models.directory_entry.DirectoryEntry, values: collections.abc.Mapping[str, Any], set_name: bool = False, force_update: bool = False) directory.models.directory_entry.DirectoryEntry[source]
 
- structure_configuration_observer(structure: str, configuration: directory.types.DirectoryConfiguration) None[source]
 
- migration(new_structure: str, new_configuration: directory.types.DirectoryConfiguration | None) onegov.directory.migration.DirectoryMigration[source]
 
- class directory.models.directory.EntryRecipient[source]
 Bases:
onegov.core.orm.Base,onegov.core.orm.mixins.TimestampMixin,onegov.core.orm.mixins.ContentMixinRepresents a single recipient.
- property subscription: EntrySubscription[source]
 
- property is_inactive: bool[source]
 Checks if the directory entry recipient’s email address is marked as inactive.
- Returns:
 bool: True if the email address is marked as inactive, False otherwise.