0

I'm not good at flask and a naturally django developer I was forced to because it is already developed..

May question is how to use delete_many using flask-cache

cache.delete_many(["sample_4", "sample_5"])

This returns an error:

TypeError: cannot concatenate 'str' and 'list' objects

I'm aware that this is the right way, but what I want is a list of keys as a parameter to be deleted

cache.delete_many("sample_3", "sample_2")

I

Dean Christian Armada
  • 6,724
  • 9
  • 67
  • 116

1 Answers1

1

You can call delete_many with arguments unpacked from a list

cache.delete_many(*["sample_4", "sample_5"])
r-m-n
  • 14,192
  • 4
  • 69
  • 68