1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-07 02:35:10 +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) # return render_template('bookmarks.html', bookmarks)
#else: #else:
# abort(404) # abort(404)
tags = get_tags_for_user(userkey)
if request.method == 'POST': if request.method == 'POST':
filter_on = request.form['filter'] 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: else:
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey) 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)