Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

first implementation of search, with only one word

This commit is contained in:
Péter Henrik Gombos 2011-10-08 15:20:50 +00:00
parent 14d98f3d57
commit 1076b8ecaa
1 changed files with 5 additions and 1 deletions

View File

@ -226,7 +226,11 @@ def list_cmd(connection, what):
fun(connection) fun(connection)
def search_book(connection, search_strings, search_description=False): 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): def search_person(connection, search_strings):
pass pass