translator_directory.collections.documents

Attributes

DEFAULT_DOCUMENT_CATEGORIES

Classes

TranslatorDocumentCollection

Manages files.

Module Contents

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.

supported_content_types = 'all'[source]
translator_id[source]
category[source]
property translator: onegov.translator_directory.models.translator.Translator | None[source]
property unique_categories: list[str][source]

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

property files_by_category: tuple[tuple[str, tuple[onegov.file.File, Ellipsis]], Ellipsis][source]