From 1076b8ecaa7bfe484c71dbf2b35dfdd68a5c8de2 Mon Sep 17 00:00:00 2001 From: gombos Date: Sat, 8 Oct 2011 15:20:50 +0000 Subject: [PATCH] first implementation of search, with only one word --- cli/worblehat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/worblehat.py b/cli/worblehat.py index fd45de0..c46a9ba 100644 --- a/cli/worblehat.py +++ b/cli/worblehat.py @@ -226,7 +226,11 @@ def list_cmd(connection, what): fun(connection) def search_book(connection, search_strings, search_description=False): - pass + c = connection.cursor() + c.execute('SELECT * FROM book WHERE book.title LIKE %(search_strings)s', {"search_strings": '%' + search_strings[0] + '%'}) + for i in xrange(c.rowcount): + cat = fetchone_dict(c) + print cat['title'] def search_person(connection, search_strings): pass