本文整理汇总了Python中Products.CMFCore.PortalContent.PortalContent类的典型用法代码示例。如果您正苦于以下问题:Python PortalContent类的具体用法?Python PortalContent怎么用?Python PortalContent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PortalContent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _initContent
def _initContent(self, folder, id):
from Products.CMFCore.PortalContent import PortalContent
c = PortalContent()
c._setId(id)
c.meta_type = 'File'
folder._setObject(id, c)
return folder._getOb(id)
示例2: test_patch_undeserializable_object_returns_501
def test_patch_undeserializable_object_returns_501(self):
obj = PortalContent()
obj.id = 'obj1'
obj.portal_type = 'Undeserializable Type'
self.portal._setObject(obj.id, obj)
transaction.commit()
response = requests.patch(
self.portal.obj1.absolute_url(),
headers={'Accept': 'application/json'},
auth=(SITE_OWNER_NAME, SITE_OWNER_PASSWORD),
data='{"id": "patched_obj1"}',
)
self.assertEqual(501, response.status_code)
self.assertIn('Undeserializable Type', response.text)
示例3: manage_beforeDelete
def manage_beforeDelete( self, item, container ):
self.before_delete_called = 1
if self.catalog:
PortalContent.manage_beforeDelete( self, item, container )
示例4: manage_afterAdd
def manage_afterAdd( self, item, container ):
self.after_add_called = 1
if self.catalog:
PortalContent.manage_afterAdd( self, item, container )
示例5: manage_beforeDelete
def manage_beforeDelete(self, item, container):
"""Both of my parents have a beforeDelete method"""
PortalContent.manage_beforeDelete(self, item, container)
OFS.Image.File.manage_beforeDelete(self, item, container)
示例6: manage_afterClone
def manage_afterClone(self, item):
"""Both of my parents have an afterClone method"""
OFS.Image.File.manage_afterClone(self, item)
PortalContent.manage_afterClone(self, item)
示例7: manage_afterAdd
def manage_afterAdd(self, item, container):
"""Both of my parents have an afterAdd method"""
OFS.Image.File.manage_afterAdd(self, item, container)
PortalContent.manage_afterAdd(self, item, container)
示例8: manage_afterClone
def manage_afterClone(self, item):
PortalContent.manage_afterClone(self, item)
self.uid = self.make_uuid(id)
示例9: manage_afterAdd
def manage_afterAdd(self, item, container):
""" Add self to the workflow and catalog. """
PortalFolder.manage_afterAdd(self, item, container)
PortalContent.manage_afterAdd(self, item, container)
示例10: manage_afterAdd
def manage_afterAdd(self, item, container):
" Add self to the workflow and catalog. "
# Recurse in the children (ObjectManager)
PortalFolder.manage_afterAdd(self, item, container)
# Add self to workflow and catalog
PortalContent.manage_afterAdd(self, item, container)