当前位置: 首页>>代码示例>>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;未经允许,请勿转载。