MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _no_criterion_assertion

Method _no_criterion_assertion

lib/sqlalchemy/orm/query.py:384–403  ·  view source on GitHub ↗
(
        self, meth: str, order_by: bool = True, distinct: bool = True
    )

Source from the content-addressed store, hash-verified

382 self._no_criterion_assertion("get", order_by=False, distinct=False)
383
384 def _no_criterion_assertion(
385 self, meth: str, order_by: bool = True, distinct: bool = True
386 ) -> None:
387 if not self._enable_assertions:
388 return
389 if (
390 self._where_criteria
391 or self._statement is not None
392 or self._from_obj
393 or self._setup_joins
394 or self._limit_clause is not None
395 or self._offset_clause is not None
396 or self._group_by_clauses
397 or (order_by and self._order_by_clauses)
398 or (distinct and self._distinct)
399 ):
400 raise sa_exc.InvalidRequestError(
401 "Query.%s() being called on a "
402 "Query with existing criterion. " % meth
403 )
404
405 def _no_criterion_condition(
406 self, meth: str, order_by: bool = True, distinct: bool = True

Calls

no outgoing calls