code: def _extract_where(cls, queryset):
          
          if not cls._is_simple_query(queryset.query):
              raise ValueError("This QuerySet's WHERE clause is too complex to "
                               "be used in a HANDLER")
  
          sql, params = queryset.query.sql_with_params()
          where_pos = sql.find('WHERE ')
          if where_pos != -1:
              # Cut the query to extract just its WHERE clause
              where_clause = sql[where_pos:]
              # Replace absolute table.column references with relative ones
              # since that is all HANDLER can work with
              # This is a bit flakey - if you inserted extra SQL with extra() or
              # an expression or something it might break.
              where_clause, _ = cls.absolute_col_re.subn(r"\1", where_clause)
              return (where_clause, params)
          else:
              return ("", ())
docs: Was this a queryset with filters/excludes/expressions set? If so,
          extract the WHERE clause from the ORM output so we can use it in the
          handler queries.