gazette.views.notice_attachments

Functions

view_notice_attachments(→ RenderData | Response)

View all attachments to a single notice and allow to drop new

upload_attachment(→ webob.Response)

Upload an attachment and add it to the notice.

delete_attachment(→ RenderData | Response)

Delete a notice attachment.

Module Contents

gazette.views.notice_attachments.view_notice_attachments(self: onegov.gazette.models.GazetteNotice, request: onegov.gazette.request.GazetteRequest) RenderData | Response[source]

View all attachments to a single notice and allow to drop new attachments.

Silently redirects to the notice view if the notice has already been accepted for non-admins.

gazette.views.notice_attachments.upload_attachment(self: onegov.gazette.models.GazetteNotice, request: onegov.gazette.request.GazetteRequest) webob.Response[source]

Upload an attachment and add it to the notice.

Raises a HTTP 405 (Metho not Allowed) for non-admins if the notice has already been accepted.

Raises a HTTP 415 (Unsupported Media Type) if the file format is not supported.

gazette.views.notice_attachments.delete_attachment(self: onegov.gazette.models.GazetteNoticeFile, request: onegov.gazette.request.GazetteRequest, form: onegov.gazette.forms.EmptyForm) RenderData | Response[source]

Delete a notice attachment.