Onegov Feriennet API

Application

class onegov.feriennet.app.FeriennetApp[source]
version = '1.6.16'

the version of this application (do not change manually!)

request_class

alias of onegov.feriennet.request.FeriennetRequest

Returns True if the given request is allowed to access private search results. By default every logged in user has access to those.

This method may be overwritten if this is not desired.

banner(request, id)[source]

Randomly returns the html to one of the available booking banners.

invoice_schema_config()[source]

Returns the currently active schema_name and it’s config.

invoice_collection(period_id=None, user_id=None)[source]

Returns the invoice collection guaranteed to be configured according to the organisation’s settings.

invoice_bucket()[source]

Returns the active invoice reference bucket.

Paths

Security

onegov.feriennet.security.is_owner(username, activity)[source]

Returns true if the given username is the owner of the given activity.

onegov.feriennet.security.has_private_permission_logged_in(app, identity, model, permission)[source]

Take away private permission for editors. For exceptions see the permission rules below.

onegov.feriennet.security.has_private_permission_site_collection(app, identity, model, permission)[source]

Give editors the ability to access the site collection.

onegov.feriennet.security.has_private_permission_image_collection(app, identity, model, permission)[source]

Give editors the ability to access the image file collection (but not the file collection!).

onegov.feriennet.security.has_private_permission_activity_collections(app, identity, model, permission)[source]

Give the editor private permission for activity collections (needed to create new activites).

onegov.feriennet.security.has_private_permission_activities(app, identity, model, permission)[source]

Give the editor private permission for activities.

onegov.feriennet.security.has_private_permission_occasions(app, identity, model, permission)[source]

Give the editor private permission for occasions.

onegov.feriennet.security.has_private_permission_notifications(app, identity, model, permission)[source]

Give the editor private permission for notification templates.

onegov.feriennet.security.has_private_permission_notification(app, identity, model, permission)[source]

Give the editor private permission for notification templates.

onegov.feriennet.security.has_public_permission_not_logged_in(app, identity, model, permission)[source]

Only make activites anonymously accessible with certain states.

onegov.feriennet.security.has_public_permission_logged_in(app, identity, model, permission)[source]

Only make activites accessible with certain states (or if owner).

onegov.feriennet.security.has_personal_permission_booking(app, identity, model, permission)[source]

Ensure that logged in users may only change their own bookings.

onegov.feriennet.security.has_private_permission_occasion_attendee_collection(app, identity, model, permission)[source]

Ensure that organisators have access to the attendee colleciton.

Models

class onegov.feriennet.models.activity.VacationActivity(**kwargs)[source]
property es_public

Returns True if the model is available to be found by the public. If false, only editors/admins will see this object in the search results.

property es_skip

Returns True if the indexing of this specific model instance should be skipped.

class onegov.feriennet.models.activity.ActivityTicket(**kwargs)[source]
class onegov.feriennet.models.activity.VacationActivityHandler(ticket, handler_id, handler_data)[source]
property deleted

Returns true if the underlying model was deleted. It is best to never let that happen, as we want tickets to stay around forever.

However, this can make sense in certain scenarios. Note that if you do delete your underlying model, make sure to call onegov.ticket.models.Ticket.create_snapshot() beforehand!

property email

Returns the email address behind the ticket request.

property title

Returns the title of the ticket. If this title may change over time, the handler must call self.refresh() when there’s a change.

property group

Returns the group of the ticket. If this group may change over time, the handler must call self.refresh() when there’s a change.

property extra_data

An array of string values which are indexed in elasticsearch when the ticket is stored there.

property undecided

Returns true if there has been no decision about the subject of this handler.

For example, if a reservation ticket has been accepted, but the reservation has been neither confirmed nor cancelled, the ticket can be seen as undecided.

This is an optional flag that may be implemented by handlers. If a ticket is undecided, the UI might show a special icon and it might warn the user if he closes the ticket without making a decision.

By default, the ticket is assumed to be decided for backwards compatibility and for tickets where this does not make sense (a simple form submission may not have any way of knowing if there has been a decision or not).

get_summary(request)[source]

Returns the summary of the current ticket as a html string.

Returns the links associated with the current ticket in the following format:

[
    ('Link Title', 'http://link'),
    ('Link Title 2', 'http://link2'),
]

If the links are not tuples, but callables, they will be called with the request which should return the rendered link.

Collections

class onegov.feriennet.collections.activity.VacationActivityCollection(session, type=None, page=0, filter=None, identity=None)[source]
transform_batch_query(query)[source]

Allows subclasses to transform the given query before it is used to retrieve the batch. This is a good place to add additional loading that should only apply to the batch (say joining other values to the batch which are then not loaded by the whole query).

query_base()[source]

Returns the query based used by query(). Overriding this function is useful to apply a general filter to the query before any other filter is applied.

For example, a policy can be enforced that only allows public activites.

page_by_index(index)[source]

Returns the page at the given index. A page here means an instance of the class inheriting from the Pagination base class.

Forms

class onegov.feriennet.forms.activity.VacationActivityForm(*args, **kwargs)[source]

Views

Layout

class onegov.feriennet.layout.DefaultLayout(model, request)[source]
class onegov.feriennet.layout.VacationActivityCollectionLayout(model, request)[source]
class onegov.feriennet.layout.BookingCollectionLayout(model, request, user=None)[source]
class onegov.feriennet.layout.GroupInviteLayout(model, request)[source]
class onegov.feriennet.layout.VacationActivityFormLayout(model, request, title)[source]
class onegov.feriennet.layout.OccasionFormLayout(model, request, title)[source]
class onegov.feriennet.layout.VacationActivityLayout(model, request)[source]
class onegov.feriennet.layout.PeriodCollectionLayout(model, request)[source]
class onegov.feriennet.layout.PeriodFormLayout(model, request, title)[source]
class onegov.feriennet.layout.MatchCollectionLayout(model, request)[source]
class onegov.feriennet.layout.BillingCollectionLayout(model, request)[source]
class onegov.feriennet.layout.OnlinePaymentsLayout(*args, **kwargs)[source]
class onegov.feriennet.layout.BillingCollectionImportLayout(model, request)[source]
class onegov.feriennet.layout.BillingCollectionManualBookingLayout(model, request)[source]
class onegov.feriennet.layout.InvoiceLayout(model, request, title)[source]
class onegov.feriennet.layout.DonationLayout(model, request, title)[source]
class onegov.feriennet.layout.OccasionAttendeeLayout(model, request)[source]
class onegov.feriennet.layout.NotificationTemplateCollectionLayout(model, request, subtitle=None)[source]
class onegov.feriennet.layout.NotificationTemplateLayout(model, request, subtitle=None)[source]

Theme

class onegov.feriennet.theme.FeriennetTheme(compress=True)[source]
property post_imports

Imports added after the foundation import. The imports must be found in one of the paths (see extra_search_paths).

The form of a single import is ‘example’ (which would search for files named ‘example.scss’)

property extra_search_paths

A list of absolute search paths added before the actual foundation search path.

Initial Content

Homepage Widgets