''' Resources (sub) package, used to connect URLs to views ''' class BaseChildResource: def __init__(self, request, name, parent): ''' Create a child resource :param pyramid.request.Request request: the current request object :param str name: the name of the resource :param parent: the parent resouce ''' self.request = request self.__name__ = name self.__parent__ = parent def __acl__(self): ''' access controll list for the resource ''' raise NotImplementedError() def _prepare_form(self, schema, prefill=None, **settings): ''' prepares a deform form for the resource''' form = schema.as_form(self.request, **settings) if prefill is not None: form.set_appstruct(prefill) return form