Latest Version: 0.9.6.2

Warning

This documentation does not refer to the most recent version of Pylons. Current Documentation

decorators

Custom Decorators, currently jsonify, validate, and 2 REST decorators


Attributes

a jsonify

<pylons.decorator.decorator object at 0x14dba90>

Functions

f validate(schema=None, validators=None, form=None) ...

Validate input either for a FormEncode schema, or individual validators

Given a form schema or dict of validators, validate will attempt to validate the schema or validator list.

If validation was succesfull, the valid result dict will be saved as
self.form_results. Otherwise, the action will be re-run as if it was a GET, and the output will be filled by FormEncode's htmlfill to fill in the form field errors.

Example:

class SomeController(BaseController):

    def create(self, id):
        return render_response('/myform.myt')

    @validate(schema=model.forms.myshema(), form='create')
    def update(self, id):
        # Do something with self.form_results
        pass

Modules

The pylons.decorators module exposes 1 submodules:

rest
REST decorators

See the source for more information.

Top