Special Views

Subclasses of cwf.views.base.View that override the cwf.views.base.View.execute() method.

The execute method is used to get a view for the target to render and call it.

These classes overwrite this behaviour to restrict or modify the result of calling the target.

Staff View

class cwf.views.views.StaffView[source]

Restrict to staff members

execute(target, request, args, kwargs)[source]

Use the django provided staff_member_required decorator to ensure only staff members can access any target on this class.

Local Only View

class cwf.views.views.LocalOnlyView[source]

Restrict to local users only

execute(target, request, args, kwargs)[source]

Raise a 404 if the Remote Address of the user is not 127.0.0.1.

Otherwise proceed as normal.

JSView

class cwf.views.views.JSView[source]

Convert target output into a json response

execute(target, request, args, kwargs)[source]

Assume the result of calling the target returns (template, data).

Proceed to return the data as a json response