-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API sugar for common depend_on_row patterns #3
Comments
Another nice one would be to have something for "expire this cache for all arguments if the model matches this predicate". This could probably replace a lot of unnecessarily broad uses of |
That actually exists, it's the |
(But it could also be useful to have shortcuts for defining those without lambdas too -- maybe passing in a QuerySet-like object.) |
Ah, TIL. |
The idea would be to reduce the amount of lambdas you have to write. Currently there already exists
A useful one would be:
Another one that might be slightly trickier is
depend_on_cache
:More generally, could also support using lambdas as per-key selectors:
This would be useful in the case where the per-key selectors are simple functions, like
operator.methodcaller('something')
, and also has the benefit of being able to create the tokens automatically ahead of time.The text was updated successfully, but these errors were encountered: