translator_directory.collections.documents

Module Contents

Classes

TranslatorDocumentCollection

Manages files.

Attributes

DEFAULT_DOCUMENT_CATEGORIES

translator_directory.collections.documents.DEFAULT_DOCUMENT_CATEGORIES = ('Antrag', 'Diplome und Zertifikate', 'Abklärungen', 'Bestätigungen der Koordinationsstelle',...[source]
class translator_directory.collections.documents.TranslatorDocumentCollection(session: sqlalchemy.orm.Session, translator_id: uuid.UUID, category: str | None)[source]

Bases: onegov.file.FileCollection[onegov.file.File]

Manages files.

Parameters:
  • session – The SQLAlchemy db session to use.

  • type – The polymorphic type to use and to filter for, or ‘*’ for all.

  • allow_duplicates

    Prevents duplicates if set to false. Duplicates are detected before pre-processing, so already stored files may be downloaded and added again, as they might have changed during the upload.

    Note that this does not change existing files. It only prevents new duplicates from being added.

property files_by_category: tuple[tuple[str, tuple[onegov.file.File, Ellipsis]], Ellipsis][source]
supported_content_types = 'all'[source]
translator() onegov.translator_directory.models.translator.Translator | None[source]
unique_categories() list[str][source]

Returns a list of the defined default categories and the ones in the database.