MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _no_criterion_assertion

Method _no_criterion_assertion

lib/sqlalchemy/orm/query.py:399–418  ·  lib/sqlalchemy/orm/query.py::Query._no_criterion_assertion
(
        self, meth: str, order_by: bool = True, distinct: bool = True
    )

Source from the content-addressed store, hash-verified

397 self._no_criterion_assertion(class="st">"get", order_by=False, distinct=False)
398
399 def _no_criterion_assertion(
400 self, meth: str, order_by: bool = True, distinct: bool = True
401 ) -> None:
402 if not self._enable_assertions:
403 return
404 if (
405 self._where_criteria
406 or self._statement is not None
407 or self._from_obj
408 or self._setup_joins
409 or self._limit_clause is not None
410 or self._offset_clause is not None
411 or self._group_by_clauses
412 or (order_by and self._order_by_clauses)
413 or (distinct and self._distinct)
414 ):
415 raise sa_exc.InvalidRequestError(
416 class="st">"Query.%s() being called on a "
417 class="st">"Query with existing criterion. " % meth
418 )
419
420 def _no_criterion_condition(
421 self, meth: str, order_by: bool = True, distinct: bool = True

Calls

no outgoing calls