當前位置: 首頁>>代碼示例>>Python>>正文


Python libDatabase.GetDataFolder類代碼示例

本文整理匯總了Python中libDatabase.GetDataFolder的典型用法代碼示例。如果您正苦於以下問題:Python GetDataFolder類的具體用法?Python GetDataFolder怎麽用?Python GetDataFolder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GetDataFolder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: RemoveProfessionalName

def RemoveProfessionalName(objHere):
    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            if "FullName" in objMember.objectIds():
                if not objMember.Name:
                    objMember.Name = objMember.FullName
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:7,代碼來源:E3Upgrade.py

示例2: PostFixCheck

def PostFixCheck(objHere):
    strResult = """<fieldset>
    <legend>Post-fix check</legend>"""

    strResult += "<ol>\n"
    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            if "ListMemberships" in objMember.objectIds():
                if "ECL" in objMember.ListMemberships.objectIds():
                    strOldDeliveryMode = objMember.ListMemberships.ECL.myDeliveryMode
                    strOldDeliveryAddress = objMember.ListMemberships.ECL.EmailAddress
                    strDeliveryFrequency = objMember.EmailFrequency_ECL
                    strDigestMode = objMember.EmailDigestMode
                    strDeliveryAddress = objMember.EmailDeliveryAddress

                    if strOldDeliveryMode == "NoMail" and strDeliveryFrequency == "Direct" and objMember.NoMail:
                        pass
                    elif strOldDeliveryMode == "Direct" and strDeliveryFrequency == "Direct" and strDigestMode == "StructuredDigest":
                        pass
                    elif strOldDeliveryMode in ["MIMEDigest", "TextDigest", "StructuredDigest", "TopicsList"] and strDeliveryFrequency == "Daily" and strDigestMode == strOldDeliveryMode:
                        pass
                    else:
                        strResult += "<li>%s, from %s to %s - %s</li>" % (objMember.id, strOldDeliveryMode, strDeliveryFrequency, strDigestMode)

    strResult += "</ol>\n"
    strResult += "</fieldset>"
    return strResult
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:28,代碼來源:E3Admin.py

示例3: ConvertNameToUstring

def ConvertNameToUstring(objHere):
    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            strName = ToUnicode(objMember.Name)
            objMember.manage_delProperties(("Name", ))
            objMember.manage_addProperty("Name", strName, "ustring")
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:7,代碼來源:E3Upgrade.py

示例4: ChangeEmailSettings

def ChangeEmailSettings(objHere):
    # Old setting:
    #   (member).ListMemberships.ECL.myDeliveryMode
    #   (member).ListMemberships.ECL.EmailAddress

    # New settings:
    #   (member).EmailDigestMode
    #   (member).EmailFrequency-ECL
    #   (member).EmailDeliveryAddress

    # Unchanged:
    #   (member).NoMail
    #   (member).ContactEmailAddress

    # Might happen later:
    #   (member).EmailFrequency-ECL-Adverts, etc

    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            if not objMember.hasProperty("EmailDigestMode"):
                strDeliveryMode = objMember.ListMemberships.ECL.GetDeliveryMode()
                strEmailAddress = objMember.ListMemberships.ECL.EmailAddress
                objMember.manage_addProperty("EmailDeliveryAddress", strEmailAddress, "ustring")
                if "Digest" in strDeliveryMode:
                    strFrequency = "Daily"
                    strDigestMode = strDeliveryMode
                else:
                    strFrequency = "Direct"
                    strDigestMode = "StructuredDigest"
                objMember.manage_addProperty("EmailDigestMode", strDigestMode, "string")
                objMember.manage_addProperty("EmailFrequency_ECL", strFrequency, "string")
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:32,代碼來源:E3Upgrade.py

示例5: SaveStats

def SaveStats(objContext, dictStats):
    print "Saving stats"

    # Update all existing stats
    objStats = GetDataFolder(objContext, "E3ListStat")
    for objStat in objStats.objectValues("E3ListStat"):
        dtmDate = objStat.GetDateOfCount()
        if dictStats.has_key(dtmDate):
            for strItem in ("JoinedYesterday", "PaymentYesterday", "ExpiredYesterday", "AdvertPostedYesterday", "NonAdvertPostedYesterday"):
                if not objStat.hasProperty(strItem):
                    objStat.manage_addProperty(strItem, dictStats[dtmDate][strItem], 'int')
            del(dicStats[dtmDate])
        for strItem in cnStatsList:
            if not objStat.hasProperty(strItem):
                objStat.manage_addProperty(strItem, 0, "int")

    dodListStat = GetDOD(objContext, "E3ListStat")

    for dtmDate in dictStats.keys():
        objStat = dodListStat.NewObject()
        objStat.SetDateOfCount(dtmDate)
        for strItem in ("JoinedYesterday", "PaymentYesterday", "ExpiredYesterday", "AdvertPostedYesterday", "NonAdvertPostedYesterday"):
            if dictStats[dtmDate].has_key(strItem):
                objStat.manage_addProperty(strItem, dictStats[dtmDate][strItem], 'int')
        for strItem in cnStatsList:
            if not objStat.hasProperty(strItem):
                objStat.manage_addProperty(strItem, 0, "int")
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:27,代碼來源:E3Upgrade.py

示例6: u32to33AddProfileProperties

def u32to33AddProfileProperties(objHere, blnSkip = False):
    if blnSkip:
        print "Skipping: AddProfileProperties"
        return

    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            AddProperties(objMember,
                (('FullName', '', 'ustring'),
                ('TagLine', '', 'ustring'),
                ('Biography', '', 'utext'),
                ('Testimonials', '', 'utext'),
                ('Country', '', 'ustring'),
                ('Location', '', 'ustring'),
                ('Postcode', '', 'ustring'),
                ('CommercialComments', '', 'utext'),
                ('CommunityComments', '', 'utext'),
                ('ContactEmailAddress', '', 'ustring'),
                ('PhoneNumber', '', 'ustring'),
                ('Languages', '', 'utext'),
                ('WebsiteAddress', '', 'ustring'),
                ('HostOfChapter', '', 'ustring'),
                ('ShowFullName', 'Hide', 'string'),
                ('ShowCountry', 'Hide', 'string'),
                ('ShowLocation', 'Hide', 'string'),
                ('ShowPostcode', 'Hide', 'string'),
                ('ShowEmailAddress', 'Hide', 'string'),
                ('ShowPhoneNumber', 'Hide', 'string'),
                ('ShowBiography', 'Hide', 'string'),
                ('ShowCommunityComments', 'Hide', 'string')))
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:31,代碼來源:E3Upgrade.py

示例7: ParkingAccounts

def ParkingAccounts(objHere):
    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            if objMember.GetNextExpiryFromMailman() < cnFirstDate:
                if objMember.Name <> 'Unknown':
                    print objMember.Name
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:7,代碼來源:E3Admin.py

示例8: ExtractEmailAddresses

def ExtractEmailAddresses(objHere):
    """Processes all messages"""
#    objUnknownMember = SearchOne(objHere, 'E3Member', 'Username', 'Unknown')
#    if not objUnknownMember:
#        objDataObjectDefinition = GetDataFolder(objHere, 'DataObjectDefinitions').E3Member
#        objUnknownMember = objDataObjectDefinition.NewObject()
#        objUnknownMember.Username = 'Unknown'
    objArchive = GetDataFolder(objHere, 'E3Messages')
    objEmailAddresses = GetDataFolder(objHere, 'E3EmailAddress')
    objMembers = GetDataFolder(objHere, 'E3Member')

    dictAllEmailAddresses = GetAllEmailAddresses(objMembers, objEmailAddresses.Catalogue)
    dodMember = GetDOD(objHere, 'E3Member')
    dodEmailAddress = GetDOD(objHere, 'E3EmailAddress')
    intDone = 0
    for objYear in objArchive.objectValues():
        for objMonth in objYear.objectValues():
            for objThread in objMonth.objectValues():
                dictAllEmailAddresses = ExtractOneAddress(objThread, dictAllEmailAddresses, dodMember, dodEmailAddress)
                intDone = intDone + 1
#                if intDone > 100:
#                    return "done"
                for objMessage in objThread.objectValues('Folder'):
                    intDone = intDone + 1
                    dictAllEmailAddresses = ExtractOneAddress(objMessage, dictAllEmailAddresses, dodMember, dodEmailAddress)
    return "%s done" % intDone
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:26,代碼來源:E3EmailAddresses.py

示例9: ListUnconfirmedMembers

def ListUnconfirmedMembers(objHere):
    lstAddresses = []
    lstMembershipTypes = []
    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            if not objMember.MembershipType in lstMembershipTypes:
                lstMembershipTypes.append(objMember.MembershipType)

            if objMember.MembershipType == "Full" and not objMember.HasConfirmedEmailAddress:
                lstAddresses.append(objMember)

    strAddresses = ""
    for objMember in lstAddresses:
        strAddresses += '<li>%s (%s)</li>\n' % (objMember.EmailDeliveryAddress, objMember.id)

    strMembershipTypes = ""
    for strMembershipType in lstMembershipTypes:
        strMembershipTypes += "<li>%s</li>\n" % strMembershipType

    strResult = """
<h2>Membership types</h2>
<ol>
%s
</ol>
<h2>Members without confirmed email addresses</h2>
<ol>
%s
</ol>

""" % (strMembershipTypes, strAddresses)

    return strResult
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:33,代碼來源:E3Admin.py

示例10: RemindToConfirm

def RemindToConfirm(objHere):
    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            if objMember.VisitCount < 2:
                objMember.RemindToConfirm()
    return "Done"
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:7,代碼來源:E3Admin.py

示例11: GetMemberForId

def GetMemberForId(objHere, strMemberId):
    objMembers = GetDataFolder(objHere, 'E3Member')
    strBatchId = strMemberId[8:11]
    try:
        return objMembers.unrestrictedTraverse('Batch%s/%s' % (strBatchId, strMemberId))
    except:
        return None
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:7,代碼來源:E3Members.py

示例12: ImportHelpFile

def ImportHelpFile(objHere):
    objHelpFolder = GetDataFolder(objHere, "E3Help")
    for strId in objHelpFolder.objectIds("E3Help"):
        objHelpFolder.manage_delObjects(strId)
    ReadHelp(objHere)
    ReindexOne(objHere, "E3Help")
    BuildRules(objHere)
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:7,代碼來源:MetaHelp.py

示例13: ChangeMonthCount

def ChangeMonthCount(objHere, intYear, intMonth, intIncrease = 1, blnPublicCount = False):
    objE3Messages = GetDataFolder(objHere, 'E3Messages')
    if blnPublicCount:
        lstMessageCount = objE3Messages.PublicMessageCount
    else:
        lstMessageCount = objE3Messages.MessageCount
    blnFound = False
    lstResult = []
    for strYearLine in lstMessageCount:
        if not blnFound and strYearLine[:4] == str(intYear):
            blnFound = True
            lstCounts = strYearLine.split()
            lstCounts[intMonth] = str(int(lstCounts[intMonth]) + intIncrease)
            strYearLine = " ".join(lstCounts)
        lstResult.append(strYearLine)
    if not blnFound:
        lstCounts = []
        for intI in range(0, 13):
            lstCounts.append("0")
        lstCounts[intMonth] = str(intIncrease)
        lstCounts[0] = str(intYear)
        lstResult.append(" ".join(lstCounts))
    if blnPublicCount:
        objE3Messages.PublicMessageCount = lstResult
    else:
        objE3Messages.MessageCount = lstResult
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:26,代碼來源:E3Messages.py

示例14: AddPropertyToOfferings

def AddPropertyToOfferings(objHere, strPropertyName, varDefault, strType):
    objMembers = GetDataFolder(objHere, 'E3Member')
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            for objOffering in objMember.Offerings.objectValues("E3Offering"):
                if not strPropertyName in objOffering.propertyIds():
                    objOffering.manage_addProperty(strPropertyName, varDefault, strType)
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:7,代碼來源:E3Upgrade.py

示例15: UsernameExists

def UsernameExists(objHere, strUsername):
    objMembers = GetDataFolder(objHere, "E3Member")
    for objBatch in objMembers.objectValues('Folder'):
        for objMember in objBatch.objectValues('E3Member'):
            if objMember.Username.lower() == strUsername.lower():
                return True
    return False
開發者ID:CoachCoen,項目名稱:ECL,代碼行數:7,代碼來源:E3StartStop.py


注:本文中的libDatabase.GetDataFolder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。