def _validate_select_where(self):
<EOL>equal_ops = [self.model._columns.get(w.field) for w in self._where if isinstance(w.operator, EqualsOperator)]<EOL>token_comparison = any([w for w in self._where if isinstance(w.value, Token)])<EOL>if not any([w.primary_key or w.index for w in equal_ops]) and not token_comparison and not self._allow_filtering:<EOL><INDENT>raise QueryException('<STR_LIT>')<EOL><DEDENT>if not self._allow_filtering:<EOL><INDENT>if not any([w.index for w in equal_ops]):<EOL><INDENT>if not any([w.partition_key for w in equal_ops]) and not token_comparison:<EOL><INDENT>raise QueryException('<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>
Checks that a filterset will not create invalid select statement