org.views.files

The onegov org collection of files uploaded to the site.

Attributes

FileT

Classes

Img

Represents an img element.

Functions

get_thumbnail_size(→ tuple[str, str])

view_get_file_collection(→ onegov.core.types.RenderData)

view_file_details(→ str)

handle_publish(→ None)

handle_unpublish(→ None)

toggle_publication(→ None)

handle_update_publish_date(→ None)

handle_update_start_date(→ None)

handle_update_end_date(→ None)

view_get_image_collection(→ onegov.core.types.RenderData)

view_get_file_collection_json(→ onegov.core.types.JSON_ro)

view_get_image_collection_json(→ list[dict[str, Any]])

handle_file_upload(→ FileT)

Stores the file given with the request and returns the new file object.

view_upload_file(…)

view_upload_general_file(→ str)

view_upload_image_file(→ str)

view_upload_file_by_json(→ onegov.core.types.JSON_ro)

view_file_digest(→ str)

handle_sign(→ str)

view_old_files_redirect(→ Response | str)

Redirects to the migrated depot file if possible. As a result, old

assert_has_mtan_access(→ None)

view_directory_file(→ depot.io.interfaces.StoredFile)

view_directory_thumbnail(→ StoredFile | Response)

view_directory_file_head(→ depot.io.interfaces.StoredFile)

view_directory_thumbnail_head(→ StoredFile | Response)

Module Contents

org.views.files.FileT[source]
org.views.files.get_thumbnail_size(image: onegov.org.models.ImageFile) tuple[str, str][source]
class org.views.files.Img(src: str, alt: str | None = None, title: str | None = None, url: str | None = None, extra: str | None = None, width: str | None = None, height: str | None = None)[source]

Represents an img element.

__slots__ = ('src', 'alt', 'title', 'url', 'extra', 'width', 'height')[source]
src[source]
alt[source]
title[source]
url[source]
width[source]
height[source]
extra[source]
classmethod from_image(layout: onegov.org.layout.DefaultLayout, image: onegov.org.models.ImageFile) Self[source]
org.views.files.view_get_file_collection(self: onegov.org.models.GeneralFileCollection, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultLayout | None = None) onegov.core.types.RenderData[source]
org.views.files.view_file_details(self: onegov.org.models.GeneralFile, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultLayout | None = None) str[source]
org.views.files.handle_publish(self: onegov.org.models.GeneralFile, request: onegov.org.request.OrgRequest) None[source]
org.views.files.handle_unpublish(self: onegov.org.models.GeneralFile, request: onegov.org.request.OrgRequest) None[source]
org.views.files.toggle_publication(self: onegov.org.models.GeneralFile, request: onegov.org.request.OrgRequest) None[source]
org.views.files.handle_update_publish_date(self: onegov.org.models.GeneralFile, request: onegov.org.request.OrgRequest) None[source]
org.views.files.handle_update_start_date(layout: onegov.org.layout.DefaultLayout, request: onegov.org.request.OrgRequest, self: onegov.org.models.GeneralFile) None[source]
org.views.files.handle_update_end_date(layout: onegov.org.layout.DefaultLayout, request: onegov.org.request.OrgRequest, self: onegov.org.models.GeneralFile) None[source]
org.views.files.view_get_image_collection(self: BaseImageFileCollection[Any], request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultLayout | None = None) onegov.core.types.RenderData[source]
org.views.files.view_get_file_collection_json(self: onegov.org.models.GeneralFileCollection, request: onegov.org.request.OrgRequest) onegov.core.types.JSON_ro[source]
org.views.files.view_get_image_collection_json(self: BaseImageFileCollection[Any], request: onegov.org.request.OrgRequest, produce_image: Callable[[ImageFile], Any] | None = None) list[dict[str, Any]][source]
org.views.files.handle_file_upload(self: FileCollection[FileT], request: onegov.org.request.OrgRequest) FileT[source]

Stores the file given with the request and returns the new file object.

org.views.files.view_upload_file(self: onegov.file.FileCollection[FileT], request: onegov.org.request.OrgRequest, return_file: Literal[True]) FileT[source]
org.views.files.view_upload_file(self: onegov.file.FileCollection[FileT], request: onegov.org.request.OrgRequest, return_file: Literal[False] = False) webob.Response
org.views.files.view_upload_general_file(self: onegov.org.models.GeneralFileCollection, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultLayout | None = None) str[source]
org.views.files.view_upload_image_file(self: onegov.org.models.ImageFileCollection, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultLayout | None = None) str[source]
org.views.files.view_upload_file_by_json(self: onegov.file.FileCollection[Any], request: onegov.org.request.OrgRequest) onegov.core.types.JSON_ro[source]
org.views.files.view_file_digest(self: onegov.org.models.GeneralFileCollection, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultLayout | None = None) str[source]
org.views.files.handle_sign(self: onegov.file.File, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.DefaultLayout | None = None) str[source]
org.views.files.view_old_files_redirect(self: onegov.org.models.LegacyFile | onegov.org.models.LegacyImage, request: onegov.org.request.OrgRequest) Response | str[source]

Redirects to the migrated depot file if possible. As a result, old image urls are preserved and will continue to function.

org.views.files.assert_has_mtan_access(self: onegov.directory.models.directory.DirectoryFile, request: onegov.org.request.OrgRequest) None[source]
org.views.files.view_directory_file(self: onegov.directory.models.directory.DirectoryFile, request: onegov.org.request.OrgRequest) depot.io.interfaces.StoredFile[source]
org.views.files.view_directory_thumbnail(self: onegov.directory.models.directory.DirectoryFile, request: onegov.org.request.OrgRequest) StoredFile | Response[source]
org.views.files.view_directory_file_head(self: onegov.directory.models.directory.DirectoryFile, request: onegov.org.request.OrgRequest) depot.io.interfaces.StoredFile[source]
org.views.files.view_directory_thumbnail_head(self: onegov.directory.models.directory.DirectoryFile, request: onegov.org.request.OrgRequest) StoredFile | Response[source]