def create(self, **data): name = data.get('__name__') if not name: name = self.chooseName(**data) return wrap(self.container).create( self.tinfo.__uri__, name, **data)
def test_cms(self): import ptah from ptah.cms.security import wrap, NodeWrapper class Test(ptah.cms.Content): __uri_factory__ = ptah.UriFactory('test') @ptah.cms.action(permission=ptah.NO_PERMISSION_REQUIRED) def update(self, *args, **data): # pragma: no cover pass t = Test() wrapper = wrap(t) self.assertIsInstance(wrapper, NodeWrapper) self.assertIs(wrapper._content, t)
def create(self, **data): name = data.get('__name__') if not name: name = self.chooseName(**data) return wrap(self.container).create(self.tinfo.__uri__, name, **data)
def apply_changes(self, **data): wrap(self.context).update(**data)