org.models.document_form
Classes
A general file (image, document, pdf, etc), referenced in the database. |
|
Mixin providing a meta/content JSON pair. Meta is a JSON column loaded |
|
Abstract base class for generic types. |
Module Contents
- class org.models.document_form.DocumentFormFile[source]
Bases:
onegov.file.File
A 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.
- class org.models.document_form.FormDocument[source]
Bases:
onegov.core.orm.Base
,onegov.core.orm.mixins.ContentMixin
,onegov.core.orm.mixins.TimestampMixin
,onegov.org.models.AccessExtension
,onegov.search.SearchableContent
,onegov.file.MultiAssociatedFiles
,onegov.org.models.ContactExtension
,onegov.org.models.extensions.PersonLinkExtension
,onegov.org.models.HoneyPotExtension
,onegov.org.models.CoordinatesExtension
,onegov.org.models.GeneralFileLinkExtension
Mixin providing a meta/content JSON pair. Meta is a JSON column loaded with each request, content is a JSON column loaded deferred (to be shown only in the detail view).
- pdf_observer(pdf: DocumentFormFile | None) None [source]
- class org.models.document_form.FormDocumentCollection(session: sqlalchemy.orm.Session, member_of: str | None = None, group: str | None = None, type: str | None = None)[source]
Bases:
onegov.core.collection.GenericCollection
[FormDocument
]Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default
- static translatable_name(model_class: type[object]) str [source]
Most collections have a base model whose name can be guessed from the collection name.
- by_name(name: str) FormDocument | None [source]
Returns the given form by name or None.
- classmethod collection_by_name() dict[str, type[onegov.core.collection.GenericCollection[Any]]] [source]
- property model_class: type[FormDocument][source]
- classmethod target(external_link: FormDocument) type[onegov.core.collection.GenericCollection[Any]] [source]
- query() sqlalchemy.orm.Query[FormDocument] [source]