app design pattern - are Blueprints right for me?
- Martijn van Exel
- 2014-01-21 @ 16:32
First off, this is my first post here. The archives show there has
not been any activity since 2012 - I can't believe that is true given
the apparent popularity of Flask, based on SO threads and activity on
Quick background on my project: I am developing a thing called
MapRoulette which is a web application to help get map errors fixed
in the OpenStreetMap project. Map errors are extracted automatically
through queries and fed into MapRoulette as Tasks. Each type of map
error is one MapRoulette Challenge. A Challenge can be hundreds,
thousands, perhaps even millions of Tasks. Each Task has Actions
associated with them, an Action is created whenever the Task is
assigned to a user logging on to MapRoulette, as well as whenever a
user makes a decision about a Task (resolved, false positive,..).
MapRoulette uses Flask, Flask-Restful, Flask-SQLAlchemy and
Flask-Script so far. The database is postgresql / postgis.
Currently there is one Tasks table and one Actions table shared
between all Challenges. I feel this will not scale well as the number
of Challenges grows and especially the Actions table gets huge.
So I am thinking of branching off each challenge into its own database
(schema), but I am not sure how to do this. I am looking at this
pattern  which suggests something like a model factory that is then
called in the blueprint code. Is this something you would do in this
case? Why (not)?
Martijn van Exel
Re: [flask] app design pattern - are Blueprints right for me?
- 2014-01-21 @ 16:53
I don't think so. Blueprints here only add boilerplate.
Simply use ol' good views as you're used to. Simply change your database
code to adhere to the new schema.
I would rather use raw SQL because it would be far easier than any other
solution involving ORMs. But this is up to you.
BTW: archives are no longer updated. Please visit: