Example #1
0
def lookup_book(book_id, id_type):
    try:
        e = lookup(book_id, id_type)
        if e != None:
            b = Book()
            b.fromxml(e)
            return b
        else:
            return None
    except ValueError:
        return None
Example #2
0
 def migrate(self):
     xml = lookup(self.asin,"ASIN")
     if xml != None:
         self.fromxml(xml)
         self.save()