当前位置: 首页>>代码示例>>Python>>正文


Python SimpleItem.id方法代码示例

本文整理汇总了Python中OFS.SimpleItem.SimpleItem.id方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleItem.id方法的具体用法?Python SimpleItem.id怎么用?Python SimpleItem.id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OFS.SimpleItem.SimpleItem的用法示例。


在下文中一共展示了SimpleItem.id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: persistent_load

# 需要导入模块: from OFS.SimpleItem import SimpleItem [as 别名]
# 或者: from OFS.SimpleItem.SimpleItem import id [as 别名]
 def persistent_load(ref):
     assert ref == 'ignored'
     # Return a placeholder object that will be replaced by
     # removeNonVersionedData().
     placeholder = SimpleItem()
     placeholder.id = "ignored_subobject"
     return placeholder
开发者ID:jean,项目名称:Products.ZopeVersionControl,代码行数:9,代码来源:Version.py

示例2: _setup_workflow

# 需要导入模块: from OFS.SimpleItem import SimpleItem [as 别名]
# 或者: from OFS.SimpleItem.SimpleItem import id [as 别名]
    def _setup_workflow(self):
        args = {'id': 'collection',
                'title': 'mock_collection',
                'year': '2011',
                'endyear': '2012',
                'partofyear': 'wholeyear',
                'country': 'http://rod.eionet.eu.int/spatial/2',
                'locality': '',
                'descr': '',
                'dataflow_uris': ['http://rod.eionet.eu.int/obligations/8'],
                'dataflow_uris': [],
                'allow_collections': True,
                'allow_envelopes': True}
        col = Collection(**args)
        self.app._setObject('collection', col)
        self.app._setObject('Templates', Folder('Templates'))
        template = SimpleItem()
        template.id = 'StartActivity'
        template.__call__ = Mock(return_value='Envelope Test Template')
        self.app.Templates._setOb('StartActivity', template)
        self.app.Templates.StartActivity.title_or_id = Mock(return_value='Start Activity Template')

        self.create_process(self, 'process')
        self.wf.addApplication('StartActivity', 'Templates/StartActivity')
        self.wf.process.addActivity('AutoBegin',
                            split_mode='xor',
                            join_mode='xor',
                            start_mode=1,
                            application='StartActivity')
        self.wf.process.begin = 'AutoBegin'
        self.wf.setProcessMappings('process', '1', '1')
开发者ID:eea,项目名称:Products.Reportek,代码行数:33,代码来源:common.py

示例3: create_cepaa_set

# 需要导入模块: from OFS.SimpleItem import SimpleItem [as 别名]
# 或者: from OFS.SimpleItem.SimpleItem import id [as 别名]
    def create_cepaa_set(self, idx):
        col_id = "col%s" %idx
        env_id = "env%s" %idx
        proc_id = "proc%s" %idx
        act_id = "act%s" %idx
        app_id = "act%s" %idx
        country = 'http://spatial/%s' %idx
        dataflow_uris = 'http://obligation/%idx' %idx
        "create collection, envelope, process, activity, application"
        col = Collection(col_id, country=country, dataflow_uris=dataflow_uris)
        self.app._setOb(col_id, col)

        self.app.Templates.StartActivity = Mock(return_value='Test Application')
        self.app.Templates.StartActivity.title_or_id = Mock(return_value='Start Activity Template')
        self.create_process(self, proc_id)
        self.wf.addApplication(app_id, 'SomeFolder/%s' %app_id)

        self.app.Applications._setOb(proc_id, Folder(proc_id))
        proc = getattr(self.app.Applications, proc_id)

        app = SimpleItem(app_id)
        app.id = app_id
        app.__call__ = Mock(return_value='Test Application')
        proc._setOb(app_id, app)
        getattr(self.wf, proc_id).addActivity(act_id,
                            split_mode='xor',
                            join_mode='xor',
                            start_mode=1)
        getattr(self.wf, proc_id).begin = act_id
        self.wf.setProcessMappings(proc_id, '1', '1')

        env = Envelope(process=getattr(self.wf, proc_id),
                       title='FirstEnvelope',
                       authUser='TestUser',
                       year=2012,
                       endyear=2013,
                       partofyear='January',
                       country='http://spatial/1',
                       locality='TestLocality',
                       descr='TestDescription')
        env._content_registry_ping = Mock()
        env.id = env_id
        getattr(self.app, col_id)._setOb(env_id, env)
        setattr(self, col_id, getattr(self.app, col_id))
        setattr(self, env_id, getattr(getattr(self.app, col_id), env_id))
        getattr(self, env_id).startInstance(self.app.REQUEST)
开发者ID:eea,项目名称:Products.Reportek,代码行数:48,代码来源:common.py

示例4: _createObject

# 需要导入模块: from OFS.SimpleItem import SimpleItem [as 别名]
# 或者: from OFS.SimpleItem.SimpleItem import id [as 别名]
 def _createObject(self, id):
     from OFS.SimpleItem import SimpleItem
     obj = SimpleItem()
     obj.id = id
     return obj
开发者ID:pombredanne,项目名称:Euphorie,代码行数:7,代码来源:test_utils.py


注:本文中的OFS.SimpleItem.SimpleItem.id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。