Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
 def apply_changes(self, **data):
     wrap(self.context).update(**data)
Пример #6
0
 def apply_changes(self, **data):
     wrap(self.context).update(**data)