def ProcessOneBookAuthorLink(objLink): if objLink.TableName == "book_author": strBookId = CleanLinkId(objLink.FromId) objBook = SearchOne(objLink, "MCIBook", "SourceId", strBookId) if not objBook: print "Book not found: %s" % strBookId else: strAuthorId = CleanLinkId(objLink.ToId) objAuthor = SearchOne(objLink, "MCIAuthor", "SourceId", strAuthorId) if not objAuthor: print "Author not found: %s" % strAuthorId else: objBook.Authors = AddToLines(objBook.Authors, objAuthor.Name.strip())
def ProcessOneBookAuthorLink(objLink): if objLink.TableName == 'book_author': strBookId = CleanLinkId(objLink.FromId) objBook = SearchOne(objLink, 'MCIBook', 'SourceId', strBookId) if not objBook: print "Book not found: %s" % strBookId else: strAuthorId = CleanLinkId(objLink.ToId) objAuthor = SearchOne(objLink, 'MCIAuthor', 'SourceId', strAuthorId) if not objAuthor: print "Author not found: %s" % strAuthorId else: objBook.Authors = AddToLines(objBook.Authors, objAuthor.Name.strip()) Catalogue(objBook) DeleteObject(objLink)