Package posterity :: Package web

Package web



Submodules

Classes
  Request
A paste.WSGIRequest subclass with some extra features
  FormRewriteFilter
Rewrite PUT/DELETE forms into POST forms.
  CSRFFilter
Cross Site Request Forgery protection filter
  ValidationState
Functions
 
template_loaded(template)
 
flash(msg, type='info')
Send a flash message.
 
redirect(start_response, location)
 
send_template(start_response, filename, data={})
Renders a genshi template
 
validate(schema, on_error=None)
A form validating decorator
 
format_timedelta(ts, locale, tzinfo=None)
 
shorten(text, max)
Variables
  tmpl_dir = '/private/tmp/posterity-trunk/posterity/templates'
  loader = <genshi.template.loader.TemplateLoader object at 0x21...
Function Details

flash(msg, type='info')

 

Send a flash message.

Flash messages are messages that are displayed on the next page viewed by the user. These messages are useful when the controller needs to redirect a user to a different page and likes to insert a message on that page.

send_template(start_response, filename, data={})

 

Renders a genshi template

Forms will automatically be populated with form values and validation error messages if available.

validate(schema, on_error=None)

 

A form validating decorator

POST requests are validated against the specified FormEncode schema. On success the converted form variables are stored in the wsgi environment under the key "posterity.formvars". These values can also be accessed from req.formvars.

If the validation fail, the original messages and the error messages are stored in the wsgi environment and the request is re-run as a GET-request. Forms on the resulting page will be filled with the values stored in the environment.


Variables Details

loader

Value:
TemplateLoader([tmpl_dir], auto_reload= True, variable_lookup= 'strict\
', callback= template_loaded)