Table Of Contents

Previous topic

Model Application

Next topic

View handlers

This Page

Included Applications

The application framework djpcms.views.appsite is flexible and powerful enough to handle most uses one can think of. It also comes with few battery-included implementations. These implementations are located in the djpcms.views.apps module since they may depend on external libraries and therefore are not part of the core djpcms.views.appsite module. If you want to use them, all you need to do is to make sure the dependencies are met. No settings involved.

Archive

Application which creates several views for models with a date field.

Tagging

The tagging application module contains three different applications which can be used for different projects:

TagApplication

This is a djpcms.views.appsite.ModelApplication which implements a tag view.

Dependencies:

If you want to use the tagging applications you need to install django-tagging.

TagsApplication

A djpcms.views.appsite.ModelApplication used to handle auto-complete tagging. To use it, simply add the following three lines in your APPLICATION_URL_MODULE:

from djpcms.views import appsite
from djpcms.views.apps.tagging import Tag, TagsApplication

appsite.site.register('/tagtools/', TagsApplication, model = Tag)

Then, when using tags in a form, use the following field:

from djpcms.views.apps.tagging import TagField

class myform(forms.Form):
    tags = TagField()

and tag autocomplete is done.

Sphinx Documentation

To create an application which display sphinx documentation:

from djpcms.views.docview import DocApplication

class MyProjectDocs(DocApplication):
    name = 'myprojectdocs'

In order to display documentation you need to create a template directory. In our example, djpcms will look into the following directories:

['myprojectdocs/%s.html' % pagename,
 'myprojectdocs/doc.html',
 'docs/%s.html' % pagename,
 'docs/doc.html']

where pagename is the sphinx page name (index, contents, and so forth). To get started quickly, cut and past the entire docs directory in djpcms/templates/djpcms.

class djpcms.views.apps.docs.DocApplication(baseurl, application_site, editavailable)
deflang

Default language. Default en.

defversion

Default version. Default dev.

DOCS_PICKLE_ROOT

Root class for serialized documentation. Default None.

master_doc

Specify sphinx master doc. Default index.

name_template_mapping

Dictionary which maps names to template names.