1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-06 22:05:09 +01:00

Fix for search filter

This commit is contained in:
2016-07-21 15:47:49 +02:00
parent c22cb2215a
commit 5693f5d676

View File

@@ -188,13 +188,14 @@ def bookmarks(userkey):
# return render_template('bookmarks.html', bookmarks)
#else:
# abort(404)
tags = get_tags_for_user(userkey)
if request.method == 'POST':
filter_on = request.form['filter']
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.title % "%" + filter + "%")
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.title.contains(filter_on))
return render_template('bookmarks.html', bookmarks=bookmarks, userkey=userkey, tags=tags, filter=filter_on)
else:
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey)
tags = get_tags_for_user(userkey)
return render_template('bookmarks.html', bookmarks=bookmarks, userkey=userkey, tags=tags)
return render_template('bookmarks.html', bookmarks=bookmarks, userkey=userkey, tags=tags)