Classic (General) Views in Flask

What is the best way to write general views using a flash framework?

Does @ app.route decorator support callable classes? Or am I thinking about this completely wrong?

Any help or advice would be greatly appreciated!

+5
source share
1 answer

Starting with Python 2.6, you can also apply decorators to classes. There is no built-in template for called classes because there are too many ways to implement them, but basically it would be overriding __call__in the class and creating a wrapper decorator that initializes the class.

, :)

+11

All Articles