aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/open.py
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup sql session after request. ALWAYS!Elrond2012-04-071-0/+6
| | | | | | | | | | | | The cleanup could be missed if the request handling code in app.py:__call__ exits early (due to exception, or due to one of those early "return"s). So to make sure the sql session is cleaned up for real, wrap the whole thing in a try: finally:. Also wrote a short tool to test if the session is actually empty. The tool is currently disabled, but ready to be used.
* Finally load all models.Elrond2012-03-211-2/+1
| | | | | Load all models for the media_types. This was stopped by a celery problem. But that is now fixed.
* Create load_models().Elrond2012-03-201-0/+12
| | | | | | | | | | | | So all models are ready when connecting to the db and so our "db" object has all models listed on it, create a function to load all models from the media_types, etc. Call it in setup_database() Problem: This gives celery warnings, because celery is imported before being setup properly. No idea how to fix this now. So media-type loading is excluded from load_models for now.
* Import "Base" from base instead of models.Elrond2012-03-201-2/+1
| | | | | Import the "Base" class for models from db.sql.base instead of db.sql.models.
* Disable query logging for now, so we get nicer logsElrond2012-03-201-1/+1
| | | | | | As the queries are quite verbose, disable them for now. Reenabling them should be done in the central logging config, which is another story for celery and bin/gmg.
* Improve logging of sql queries a bit.Elrond2012-03-101-1/+3
| | | | | | | | | | | | | | | | Docs: http://docs.sqlalchemy.org/en/latest/core/engines.html#configuring-logging So for an application utilizing python logging for real (and MediaGoblin should) the rule is: - Don't use echo=True, - but reconfigure the appropiate loggers' level. So replaced the echo=True by a line to reconfigure the appropiate logger to achieve the same effect. This still dumps whole bloats of SQL queries into the main log, but at least they're not duped any more.
* Cleanup Session after each request.Elrond2012-02-281-0/+1
| | | | | | | | | | | It's good practice to cleanup the SQL session after each request so that the next request gets a fresh one. It's an application decision whether one wants a just-in-case ROLLBACK or COMMIT. There are two ideas behind it, really. I have decided for ROLLBACK. The idea is "if you forget to commit your changes yourself, there's something broken. Maybe you got an exception?".
* Fix copyright statements; add LICENSE for EXIF.pyWill Kahn-Greene2012-02-081-1/+1
|
* Add copyright header and a bit of pep8ificationElrond2012-01-201-1/+18
| | | | | | Nearly all the sql files missed a copyright header. So added it! And while there fixed a few pep8 things.
* Factor out check_db_migrations_currentElrond2012-01-011-0/+4
| | | | | | | | | | When initializing the database connection the current mongo based setup checked for new migrations and warned about them. This was mongo specific so factor'd it out into a more generic check_db_migrations_current function in the mongo backend. Also created a dummy one in the sql backend.
* SQL: mongokit like interfaceElrond2011-12-181-0/+29
In trying to ease the migration to SQL, created an interface to sqlalchemy that looks a lot like the interface that is currently in use. *WARNING* Work in progress