3 ms·
Armin has stated that he thinks that declaring URL routes with decorators is a bad idea. Has he warmed up to it or decided it bearable being a minimal framework
by jokull 17y ago
Armin has stated that he thinks that declaring URL routes with decorators is a bad idea. Has he warmed up to it or decided it bearable being a minimal framework?
I think they are a bad idea. I love urls.py being kind of a TOC for your application. Apart from that I can see a lot of good ideas in here. Solid template and HTTP layers, signed cookies, avoiding the ORM, short lived messaging, proper __html__, simplistic URL reversal. I love the simple request object API (args, form, files).
I can see additional libraries around this core. High level forms library at least.
- zeemonkee 17y agoYou don't have to use decorators (they cause issues with circular dependencies as well, making it difficult to break up your views module). There is an add_url_rule method you can use to register views. An ORM is tangental to Flask - there is some docs on how to use with SQLAlchemy (which also suggests WTForms for validation) but it's ORM/DB neutral, which is a good idea. However I'm warming to the idea of avoiding an ORM completely in future projects - just use a thin layer around MySQLdb or DB of choice, like tornado.database or SQLAlchemy's query API.