tailbone.views.core

Base View Class

class tailbone.views.core.View(request, context=None)[source]

Base class for all class-based views.

file_response(path, filename=None, attachment=True)[source]

Returns a generic FileResponse from the given path

forbidden()[source]

Convenience method, to raise a HTTP 403 Forbidden exception.

get_rattail_app()[source]

Returns the Rattail AppHandler instance, creating it if necessary.

json_response(data)[source]

Convenience method to return a JSON response.

late_login_user()[source]

Returns the rattail:rattail.db.model.User instance corresponding to the “late login” form data (if any), or None.

make_progress(key, **kwargs)[source]

Create and return a tailbone.progress.SessionProgress instance, with the given key.

property rattail_config

Reference to the effective Rattail config object.

redirect(url, **kwargs)[source]

Convenience method to return a HTTP 302 response.

render_progress(progress, kwargs, template=None)[source]

Render the progress page, with given kwargs as context.

user_is_protected(user)[source]

This logic will consult the settings for a list of “protected” usernames, which should require root privileges to edit. If the given user object is represented in this list, it is considered to be protected and this method will return True; otherwise it returns False.