code: def build_where_stmt(self, ident, filters, q_filters=None, source_class=None):
          
          if q_filters is not None:
              stmts = self._parse_q_filters(ident, q_filters, source_class)
              if stmts:
                  self._ast['where'].append(stmts)
          else:
              stmts = []
              for row in filters:
                  negate = False
  
                  # pre-process NOT cases as they are nested dicts
                  if '__NOT__' in row and len(row) == 1:
                      negate = True
                      row = row['__NOT__']
  
                  for prop, op_and_val in row.items():
                      op, val = op_and_val
                      if op in _UNARY_OPERATORS:
                          # unary operators do not have a parameter
                          statement = '{0} {1}.{2} {3}'.format('NOT' if negate else '', ident, prop, op)
                      else:
                          place_holder = self._register_place_holder(ident + '_' + prop)
                          statement = '{0} {1}.{2} {3} {{{4}}}'.format('NOT' if negate else '', ident, prop, op, place_holder)
                          self._query_params[place_holder] = val
                      stmts.append(statement)
  
              self._ast['where'].append(' AND '.join(stmts))
docs: construct a where statement from some filters