rufuspollock-okfn / yourtopia

Web app for crowdsourcing preferences about index weighting such as the Human Development Index. Powers the YourTopia site - Global Development beyond GDP.
http://yourtopia.net/
14 stars 9 forks source link

Switch to sqlalchemy #41

Closed rufuspollock closed 12 years ago

marians commented 12 years ago

I made a first round of changes and committed the code. What I don't know yet is how to do the database initialization in a proper SQLalchemic way.

https://github.com/okfn/yourtopia/blob/master/yourtopia/web.py#L413

rufuspollock commented 12 years ago

@marians this is great and setting up the db is really easy, I think you just do:

db.create_all()

See http://packages.python.org/Flask-SQLAlchemy/quickstart.html#a-minimal-application

marians commented 12 years ago

The question is: Do we want database initialization as part of the application, as the result of a self-check? If yes, I'm not sure how to test if the database has been initialized already. Or do we want it as part of an install routine or part of the README?

rufuspollock commented 12 years ago

create_all is silent ...

marians commented 12 years ago

Code including db.create_all() is now committed.

rufuspollock commented 12 years ago

FIXED. While we could definitely refactor this to be nicer the system is operational :-)