Package posterity :: Module web

Module web



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
 
validate(schema, on_error)
A form validating decorator
 
pretty_date(ts)
 
shorten(text, max)
Variables
  log = logging.getLogger('web')
  tmpl_dir = '/private/tmp/posterity-0.5/posterity/templates'
  loader = <genshi.template.loader.TemplateLoader object at 0x20...
Function Details

validate(schema, on_error)

 

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\
')