示例#1
0
def ProcessOneBookCategoryLink(objLink):
    if objLink.TableName == "book_bookcategory":
        strBookId = CleanLinkId(objLink.FromId)
        strCategoryId = CleanLinkId(objLink.ToId)
        objBook = SearchOne(objLink, "MCIBook", "SourceId", strBookId)
        objCategory = SearchOne(objLink, "MCIBookCategory", "SourceId", strCategoryId)
        if not objBook:
            print "Book not found: %s" % strBookId
        if not objCategory:
            print "Category not found: %s" % strCategoryId
        if objBook and objCategory:
            objBook.Categories = AddToLines(objBook.Categories, objCategory.id)
示例#2
0
def ProcessOneBookCategoryLink(objLink):
    if objLink.TableName == 'book_bookcategory':
        strBookId = CleanLinkId(objLink.FromId)
        strCategoryId = CleanLinkId(objLink.ToId)
        objBook = SearchOne(objLink, 'MCIBook', 'SourceId', strBookId)
        objCategory = SearchOne(objLink, 'MCIBookCategory', 'SourceId', strCategoryId)
        if not objBook:
            print "Book not found: %s" % strBookId
        if not objCategory:
            print "Category not found: %s" % strCategoryId
        if objBook and objCategory:
            objBook.Categories = AddToLines(objBook.Categories, objCategory.id)
            Catalogue(objBook)
        DeleteObject(objLink)