org.views.event

The onegov org collection of images uploaded to the site.

Attributes

FormT

Functions

get_session_id(→ str)

assert_anonymous_access_only_temporary(→ None)

Raises exceptions if the current user is anonymous and no longer

event_form(…)

publish_event(→ RenderData | BaseResponse)

Publish an event.

handle_new_event(→ RenderData | BaseResponse)

Add a new event.

handle_new_event_without_workflow(...)

Create and submit a new event.

view_event(→ RenderData | BaseResponse)

View an event.

handle_edit_event(→ RenderData | BaseResponse)

Edit an event.

handle_withdraw_event(→ None)

Withdraws an (imported) event.

handle_delete_event(→ None)

Delete an event.

ical_export_event(→ morepath.request.Response)

Returns the event with all occurrences as ics.

view_latest_event(→ webob.Response)

Redirects to the latest occurrence of an event that is, either the

Module Contents

org.views.event.FormT[source]
org.views.event.get_session_id(request: onegov.org.request.OrgRequest) str[source]
org.views.event.assert_anonymous_access_only_temporary(request: onegov.org.request.OrgRequest, event: onegov.event.Event) None[source]

Raises exceptions if the current user is anonymous and no longer should be given access to the event.

Anonymous user should be able to access when creating a new event, but not anymore after that (i.e. when intiated and submitted). This is done by checking the browser session and/or a secret token in the URL.

org.views.event.event_form(model: object, request: onegov.org.request.OrgRequest, form: None = None) type[onegov.org.forms.EventForm][source]
org.views.event.event_form(model: object, request: onegov.org.request.OrgRequest, form: type[FormT]) type[FormT]
org.views.event.publish_event(self: onegov.event.Event, request: onegov.org.request.OrgRequest) RenderData | BaseResponse[source]

Publish an event.

org.views.event.handle_new_event(self: onegov.event.OccurrenceCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.EventForm, layout: onegov.org.layout.EventLayout | None = None) RenderData | BaseResponse[source]

Add a new event.

The event is created and the user is redirected to a view where he can review his submission and submit it finally.

org.views.event.handle_new_event_without_workflow(self: onegov.event.OccurrenceCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.EventForm, layout: onegov.org.layout.EventLayout | None = None) RenderData | BaseResponse[source]

Create and submit a new event.

The event is created and ticket workflow is skipped by setting the state to ‘submitted’.

org.views.event.view_event(self: onegov.event.Event, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.EventLayout | None = None) RenderData | BaseResponse[source]

View an event.

If the event is not already submitted, the submit form is displayed.

A logged-in user can view all events and might edit them, an anonymous user will be redirected.

org.views.event.handle_edit_event(self: onegov.event.Event, request: onegov.org.request.OrgRequest, form: onegov.org.forms.EventForm, layout: onegov.org.layout.EventLayout | None = None) RenderData | BaseResponse[source]

Edit an event.

An anonymous user might edit an initiated event, a logged in user can also edit all events.

org.views.event.handle_withdraw_event(self: onegov.event.Event, request: onegov.org.request.OrgRequest) None[source]

Withdraws an (imported) event.

org.views.event.handle_delete_event(self: onegov.event.Event, request: onegov.org.request.OrgRequest) None[source]

Delete an event.

org.views.event.ical_export_event(self: onegov.event.Event, request: onegov.org.request.OrgRequest) morepath.request.Response[source]

Returns the event with all occurrences as ics.

org.views.event.view_latest_event(self: onegov.event.Event, request: onegov.org.request.OrgRequest) webob.Response[source]

Redirects to the latest occurrence of an event that is, either the next future event or the last event in the past if there are no more future events.