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


Python GetDataFolder.uncatalog_object方法代码示例

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


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

示例1: ClaimEmailAddress

# 需要导入模块: from libDatabase import GetDataFolder [as 别名]
# 或者: from libDatabase.GetDataFolder import uncatalog_object [as 别名]
    def ClaimEmailAddress(self, objExistingAddress, objExistingMember):
        # Remember the details of the old address
        strOldId = objExistingAddress.id
        strEmailAddress = objExistingAddress.EmailAddress

        # Remove the old address from the catalogue
        objCatalogue = GetDataFolder(self, 'E3EmailAddress').Catalogue
        strUID = objExistingAddress.absolute_url()
        strUID = strUID[strUID.find('/') + 2:]
        strUID = strUID[strUID.find('/'):]
        objCatalogue.uncatalog_object(strUID)

        # Remove the old address
        objExistingMember.manage_delObjects(strOldId)

        # Remove the old member from the catalogue
        objCatalogue = GetDataFolder(self, 'E3Member').Catalogue
        strUID = objExistingMember.absolute_url()
        strUID = strUID[strUID.find('/') + 2:]
        strUID = strUID[strUID.find('/'):]
        objCatalogue.uncatalog_object(strUID)

        # Remove the old member
        objBatch = objExistingMember.unrestrictedTraverse('..')
        objBatch.manage_delObjects(objExistingMember.id)

        # Create a new address
        dodEmailAddress = GetDOD(self, 'E3EmailAddress')
        objNewAddress = dodEmailAddress.NewObject(self)
        objNewAddress.EmailAddress = strEmailAddress
        objNewAddress.Confirmed = True
        Catalogue(objNewAddress)

        # Find all list messages which pointed to the old id
               # Replace the id with the new id
               # Update the catalogue
        objCatalogue = GetDataFolder(self, 'E3Messages').Catalogue
        for objListMessage in SearchMany(self, 'E3Messages', 'UserId', strOldId):
            objListMessage.UserId = self.id
            objCatalogue.Catalog(objListMessage)

        # Send an email to the email address, to let them know that it has been added, and to contact me if that isn't right
        self.SendClaimedMessage(strEmailAddress)
        return objNewAddress
开发者ID:CoachCoen,项目名称:ECL,代码行数:46,代码来源:clsE3Member.py


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