wuttaweb.views.common

Common Views

class wuttaweb.views.common.CommonView(request, context=None)[source]

Common views shared by all apps.

change_theme()[source]

This view will set the global app theme, then redirect back to the referring page.

do_setup(session, data)[source]

Perform the actual setup operations. This is called from setup().

Default logic will invoke two methods on the install handler:

Parameters:
  • session – Current db session.

  • data – Form data submitted from the /setup page.

forbidden_view()[source]

This view is shown when a request triggers a 403 Forbidden error.

Note that this page template is rendered only if the user is already logged in. If they are not yet, they’re instead redirected to the login page.

Template: /forbidden.mako

home(session=None)[source]

Home page view.

Template: /home.mako

This is normally the view shown when a user navigates to the root URL for the web app.

notfound_view()[source]

This view is shown when a request triggers a 404 Not Found error.

Template: /notfound.mako

setup()[source]

View for first-time app setup, to create admin user etc.

Template: /setup.mako

This page is only meant for one-time use. As such, if the app DB contains any users, this page will always redirect to the home page.

However if no users exist yet, this will show a form which may be used to create the first admin user.

When form is submitted, this calls do_setup() to handle the actual setup. When finished, user will be redirected to the login page.

Note

As long as there are no users in the DB, both the home and login pages will automatically redirect to this one.