Filter all library and user data for guests

This commit is contained in:
JonnyWong16 2016-04-25 23:51:34 -07:00
parent d462ebe8e5
commit c0a5a8d775
13 changed files with 382 additions and 246 deletions

View file

@ -89,16 +89,15 @@ class DataTables(object):
# Build custom where parameters
if custom_where:
for w in custom_where:
c_where += w[0] + ' = ? AND '
# The order of our args changes if we are grouping
#if grouping:
# args.insert(0, w[1])
#else:
# args.append(w[1])
# My testing shows that order of args doesn't change
args.append(w[1])
if isinstance(w[1], (list, tuple)) and len(w[1]):
c_where += '('
for w_ in w[1]:
c_where += w[0] + ' = ? OR '
args.append(w_)
c_where = c_where.rstrip(' OR ') + ') AND '
else:
c_where += w[0] + ' = ? AND '
args.append(w[1])
if c_where:
c_where = 'WHERE ' + c_where.rstrip(' AND ')