Views and decorators

Standard views

class feincms.views.base.Handler

This is the default handler for feincms page content.

It isn’t a class-based-view like those in Django’s generic view framework. State should not be stored on the Handler class, because of thread-safety and cross polination issues.

Handler.build_response(request, page)

Calls prepare, render and finalize, in this order.

Handler.finalize(request, response, page)

Runs finalize() on content types having such a method, adds headers and returns the final response.

Handler.prepare(request, page)

Prepare / pre-process content types. If this method returns anything, it is treated as a HttpResponse and handed back to the visitor.

Handler.render(request, page)

The render step. Must return a HttpResponse.

feincms.views.base.handler

Default handler

Generic-views replacements

All views in the feincms.views.generic module are almost the same as their counterparts in django.views.generic (before class-based views came along), except that they add a feincms_page object to the context.

Decorators

feincms.views.decorators.add_page_to_extra_context(view_func)

Adds the best-match page to the extra_context keyword argument. Mainly used to provide generic views which integrate into the page module.

feincms.views.decorators.standalone(view_func)

Marks the view method as standalone view; this means that HttpResponse objects returned from ApplicationContent are returned directly, without further processing.

Table Of Contents

Previous topic

Utilities

Next topic

Management commands

This Page