cache_on_arguments invalidate in case of classmethod
I have following declaration:
class Takeover(db.Model, ModelMixin): @classmethod @default_cache_region.cache_on_arguments(expiration_time=600) def get_by_category_id(cls, category_id):
And I use it like this Takeover.get_by_category_id(5). Now I decided to invalidate it. It would be natural to invalidate it based on actual parameters, like this Takeover.get_by_category_id.invalidate(5), but it doesn't work, because key_generator assumes that it "has_self" (cls in this case) and drops out the first param. I think this should work differently, because it is counterintuitive and your own doc adds to confusion: "Pass to invalidate() the same arguments you’d pass to the function itself to represent a particular value".