def CreateAdditionalProperties(objHere): """Any properties that haven't been done by the other code""" objMessages = GetDataFolder(objHere, "E3Messages") print objMessages.MessageCount try: objMessages.manage_delObjects('MessageCount') except: print "Couldn't delete MessageCount, probably didn't exist" try: objMessages.manage_addProperty('MessageCount', [], 'lines') except: print "E3Messages.MessageCount already defined. No need to add property" try: objMessages.manage_addProperty('MembersCount', 0, 'int') except: print "E3Messages.MembersCount already defined. No need to add property" objE3 = GetDataFolder(objHere, "E3Data") try: objE3.manage_addProperty('LatestInvoiceNumber', 0, 'int') except: print "E3Data.LatestInvoiceNumber already defined. No need to add property" for strProperty in ('DirectListMembers', 'TextDigestMembers', 'MIMEDigestMembers', 'NoMailMembers', 'DigestList'): try: objE3.manage_addProperty(strProperty, [], 'lines') except: print "E3Data.%s already defined. No need to add property" % strProperty for strProperty in ('DigestLength', 'LatestCartId', 'MembersCount'): try: objE3.manage_addProperty(strProperty, 0, 'int') except: print "E3Data.%s already defined. No need to add property" % strProperty objE3.LatestCartId = 1
def GetNextCartId(objHere): objData = GetDataFolder(objHere, 'E3Data') intNextCartId = objData.LatestCartId + 1 objData.LatestCartId = intNextCartId return intNextCartId