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)
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)