MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / with_post_criteria

Method with_post_criteria

lib/sqlalchemy/ext/baked.py:337–356  ·  view source on GitHub ↗

Add a criteria function that will be applied post-cache. This adds a function that will be run against the :class:`_query.Query` object after it is retrieved from the cache. This currently includes **only** the :meth:`_query.Query.params` and :meth:`_query.Query.e

(self, fn)

Source from the content-addressed store, hash-verified

335 return self
336
337 def with_post_criteria(self, fn):
338 """Add a criteria function that will be applied post-cache.
339
340 This adds a function that will be run against the
341 :class:`_query.Query` object after it is retrieved from the
342 cache. This currently includes **only** the
343 :meth:`_query.Query.params` and :meth:`_query.Query.execution_options`
344 methods.
345
346 .. warning:: :meth:`_baked.Result.with_post_criteria`
347 functions are applied
348 to the :class:`_query.Query`
349 object **after** the query's SQL statement
350 object has been retrieved from the cache. Only
351 :meth:`_query.Query.params` and
352 :meth:`_query.Query.execution_options`
353 methods should be used.
354
355 """
356 return self._using_post_criteria([fn])
357
358 def _as_query(self):
359 q = self.bq._as_query(self.session).params(self._params)

Callers 7

test_firstMethod · 0.80
test_iterMethod · 0.80
test_spoiledMethod · 0.80
test_getMethod · 0.80
goMethod · 0.80

Calls 1

_using_post_criteriaMethod · 0.95

Tested by 7

test_firstMethod · 0.64
test_iterMethod · 0.64
test_spoiledMethod · 0.64
test_getMethod · 0.64
goMethod · 0.64