Correct book counting.
authorMichael Gregson <mgregson@csclub.uwaterloo.ca>
Wed, 11 Mar 2009 06:02:17 +0000 (02:02 -0400)
committerMichael Gregson <mgregson@csclub.uwaterloo.ca>
Wed, 11 Mar 2009 06:02:17 +0000 (02:02 -0400)
ceo/urwid/library.py

index 85e609b..4f777ea 100644 (file)
@@ -131,7 +131,7 @@ class BookAddPage(WizardPanel):
             book = pymazon.lookup(isbn)
 
             currents = lib.Book.select(lib.Book.q.isbn==isbn)
-            if len(currents) == 0:
+            if currents.count() == 0:
                 lib.Book(isbn=isbn, title=book.title,
                          year=book.year, publisher=book.publisher)
             else: