def build_where_stmt(self, ident, filters, q_filters=None, source_class=None):
if q_filters is not None:<EOL><INDENT>stmts = self._parse_q_filters(ident, q_filters, source_class)<EOL>if stmts:<EOL><INDENT>self._ast['<STR_LIT>'].append(stmts)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>stmts = []<EOL>for row in filters:<EOL><INDENT>negate = False<EOL>if '<STR_LIT>' in row and len(row) == <NUM_LIT:1>:<EOL><INDENT>negate = True<EOL>row = row['<STR_LIT>']<EOL><DEDENT>for prop, op_and_val in row.items():<EOL><INDENT>op, val = op_and_val<EOL>if op in _UNARY_OPERATORS:<EOL><INDENT>statement = '<STR_LIT>'.format('<STR_LIT>' if negate else '<STR_LIT>', ident, prop, op)<EOL><DEDENT>else:<EOL><INDENT>place_holder = self._register_place_holder(ident + '<STR_LIT:_>' + prop)<EOL>statement = '<STR_LIT>'.format('<STR_LIT>' if negate else '<STR_LIT>', ident, prop, op, place_holder)<EOL>self._query_params[place_holder] = val<EOL><DEDENT>stmts.append(statement)<EOL><DEDENT><DEDENT>self._ast['<STR_LIT>'].append('<STR_LIT>'.join(stmts))<EOL><DEDENT>
construct a where statement from some filters