wuttaweb.conf

Config Extension

class wuttaweb.conf.WuttaWebConfigExtension[source]

Config extension for WuttaWeb.

This sets the default plugin used for SQLAlchemy-Continuum, to WuttaWebContinuumPlugin. Which is only relevant if Wutta-Continuum is installed and enabled. For more info see Wutta-Continuum.

wuttaweb.conf.add_master_view(config, master)[source]

Pyramid directive to add the given MasterView subclass to the app’s registry.

This allows the app to dynamically present certain options for admin features etc.

This is normally called automatically for all master views, within the defaults() method.

Should you need to call this yourself, do not call it directly but instead make a similar call via the Pyramid config object:

pyramid_config.add_wutta_master_view(PoserWidgetView)
Parameters:
  • config – Reference to the Pyramid config object.

  • master – Reference to a MasterView subclass.

This function is involved in app startup; once that phase is complete you can inspect the master views like so:

master_views = request.registry.settings["wuttaweb_master_views"]

# find master views for given model class
user_views = master_views.get(model.User, [])

# some master views are registered by model name instead (if no class)
email_views = master_views.get("email_setting", [])