本文整理匯總了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