tailbone.subscribers

Event Subscribers

tailbone.subscribers.add_inbox_count(event)[source]

Adds the current user’s inbox message count to the global renderer context.

Note that this is not enabled by default; to turn it on you must do this:

config.add_subscriber(‘tailbone.subscribers.add_inbox_count’, ‘pyramid.events.BeforeRender’)

tailbone.subscribers.before_render(event)[source]

Adds goodies to the global template renderer context.

tailbone.subscribers.context_found(event)[source]

Attach some more goodies to the request object:

The following is attached to the request:

  • get_session_timeout() function

tailbone.subscribers.new_request(event, session=None)[source]

Event hook called when processing a new request.

This first invokes the upstream hooks:

It then adds more things to the request object; among them:

request.rattail_config

Reference to the app config object. Note that this will be the same as wuttaweb:request.wutta_config.

request.register_component(tagname, classname)

Function to register a Vue component for use with the app.

This can be called from wherever a component is defined, and then in the base template all registered components will be properly loaded.