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)
| 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) |