Previous topic

Applications

Next topic

Model Application

This Page

ApplicationBase

class djpcms.views.appsite.ApplicationBase(baseurl, application_site, editavailable)

Base class for djpcms applications.

baseurl

the root part of the application views urls. Must be provided with trailing slashes (ex. “/docs/”)

application_site

instance of djpcms.views.appsite.ApplicationSite, the application site manager.

editavailable

True if inline editing is available for the application.

authenticated

True if authentication is required. Default False.

has_api

Flag indicating if API is available. Default False.

inherit

Flag indicating if application views are inherited from base class. Default False.

hidden

If True the application is only used internally. Default False.

form

A form class used in the application. Default None.

form_method

Form submit method, get or post. Default post.

form_withrequest

If set to True, the request instance is passed to the form constructor. Default is False.

form_ajax

If True the form submits are performed using ajax. Default True.

form_template

Optional template for form. Can be a callable with parameter djp. Default None.

in_navigation

True if application’views can go into site navigation. Default True. No reason to change this default unless you really don’t want to see the views in the site navigation.

name

Application name. Default None, calculated from class name.

description

Application description. Default None, calculated from name.

getview(code)

Get an application view from the view code.

has_permission(request=None, obj=None)

Return True if the page can be viewed, otherwise False

parentresponse(djp, app)

Retrieve the parent djpcms.views.response.DjpResponse instance

get_form(djp, form_class, addinputs=True, form_withrequest=None, form_ajax=None, forceform=False, instance=None, **kwargs)

Build a form

submit(instance, own_view=False)

Generate the submits elements to be added to the model form.