예제 #1
0
파일: forms.py 프로젝트: runyaga/ptah
    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
파일: forms.py 프로젝트: runyaga/ptah
 def apply_changes(self, **data):
     wrap(self.context).update(**data)