to be matched using many parameters - route name - request method : POST, GET, ... - xhr - request params - match params - custom predicates function Wednesday, 1 January 14
renderer to convert def cache_callback(request, response): """Set the cache_control max_age for the response""" if request.exception is not None: response.cache_control.max_age = 360 request.add_response_callback(cache_callback) Wednesday, 1 January 14
a Template. The view needs to return a dict to populate the context renderer='templates/home.pt' renderer='package:templates/home.mak' renderer='home.jinja2' Wednesday, 1 January 14
[ (Allow, 'jack', 'view')] class Billing(object): def __init__(self, request): matchdict = request.matchdict self.id = matchdict.get('id', None) if self.id == '1': self.__acl__ = [ (Allow, 'henry', 'view'), (Allow, 'jack', 'view') ] On the class On the instance Wednesday, 1 January 14
ACL when it is the context, its parent is consulted for an ACL. class Repo(Base): __acl__ = [ (Allow, 'jack', 'view') ] class Wiki(Base): __name__ = 'wiki' __parent__ = Repo Wednesday, 1 January 14