Browse Source

changes to handle server side queries

version-14
Saurabh 12 years ago
parent
commit
e487b1a37d
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      webnotes/widgets/reportview.py

+ 3
- 1
webnotes/widgets/reportview.py View File

@@ -172,6 +172,8 @@ def build_conditions(doctype, fields, filters, docstatus):
def build_filter_conditions(filters, conditions):
"""build conditions from user filters"""
from webnotes.utils import cstr
global tables
if not tables: tables = []
for f in filters:
tname = ('`tab' + f[0] + '`')
@@ -179,7 +181,7 @@ def build_filter_conditions(filters, conditions):
tables.append(tname)
# prepare in condition
if f[2]=='in':
if f[2] in ['in', 'not in']:
opts = ["'" + t.strip().replace("'", "\\'") + "'" for t in f[3].split(',')]
f[3] = "(" + ', '.join(opts) + ")"
conditions.append(tname + '.' + f[1] + " " + f[2] + " " + f[3])


Loading…
Cancel
Save