예제 #1
0
파일: models.py 프로젝트: clarsen/booksell
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
예제 #2
0
파일: models.py 프로젝트: clarsen/booksell
 def migrate(self):
     xml = lookup(self.asin,"ASIN")
     if xml != None:
         self.fromxml(xml)
         self.save()