示例#1
0
文件: MCIBooks.py 项目: CoachCoen/ECL
def ListForTextSearch(objRequest, objHere):
    strSearchFor = GetParameter(objHere.REQUEST, 'SearchFor')
    if not strSearchFor:
        return "No search criteria entered"

    lstWords = strSearchFor.split()
    dictBooks = {}

    for strWord in lstWords:
        for strLocation in ('Title', 'SubTitle', 'ISBN', 'Authors'):
            objBooks = SearchMany(objHere, 'MCIBook', strLocation, strWord)
            dictBooks = CountBooks(dictBooks, objBooks)

    strResult = GetBooklistFromDictionary(dictBooks, len(lstWords), "words", objHere)
    if not strResult:
        strResult = "No books found"
    return """<span class = "PageTitle2">All books for &quot;%s&quot;</span><br>%s""" % (strSearchFor, strResult)
示例#2
0
def Unbounce(objMember):
    strEmailAddress = GetParameter(objMember.REQUEST, "SubmitButton")
    strEmailAddress = strEmailAddress.split()[1]
    objMember.Unbounce(strEmailAddress)
    SetMessage(objMember, '', '%s resumed' % strEmailAddress)