djpcms handles views using objects rather than functions. Each view is an instance of a class derived from djpcms.views.baseview.djpcmsview.
Base class for handling urls requests.
Tuple of request methods handled by self. By default GET and POST only:
_methods = ('get','post')
Used to override the template name in the djpcms.models.Page model instance (if it exists). Not used very often but here just in case.
The parent view of self. An instance of djpcmsview or None
The djpcms.models.Page instances associated with this view.
Given a djpcms.models.Page instance page, which may be None, returns the template file for the GET response. If template_name is specified, it uses it, otherwise if page is available, it gets the template from djpcms.models.Page.get_template(). If page is None it returns DEFAULT_TEMPLATE_NAME.
View title.
Render the Current View plugin. Return safe unicode This function is implemented by application views
Handle the RESPONSE.This function SHOULD NOT be overwritten. Several functions can be overwritten for tweaking the results. If that is not enough, maybe more hooks should be put in place. Hooks: * 'preget': for pre-processing and redirect * 'render': for creating content when there is no inner_template * extra_response: for more.
Handle the post view. This function checks the request.POST dictionary for a post_view_key specified in HTML_CLASSES (by default 'xhr')
These ajax enabled post view functions must start with the prefix ajax__ followed by the VALUE of the post_view_key.
so lets say we find in the POST dictionary
'xhr': 'change_parameter', ... }
Than there should be a function called 'ajax__change_parameter' which handle the response
Check if view can be displayed.
Hook for modifying the in_navigation property. This default implementation should suffice
Return children permitted views for self. It includes views not in navigation. In scanning for children we porposefully leave a possible object instance out of the key-values arguments. If we didn't do that, test_navigation.testMultiPageApplication would fail.
Shortcut function for redirecting to url.