aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Let SQL objects support .setdefault() and .delete()Elrond2012-02-261-0/+10
| | | | | | | | | | Some parts in the code like to use .setdefault(). So make them happy and provide a minimal version. It ignores the given default and expects the attribute to already exist. Other parts use .delete() to delete a complete object. This version expects the object to live in a session and also does the final commit.
* Fix copyright statements; add LICENSE for EXIF.pyWill Kahn-Greene2012-02-081-1/+1
|
* Nearly complete support for TagsElrond2012-01-281-0/+16
| | | | | | | | | | | These changes allow all of the rest of the code to use tags in sql as they were used on mongo. It's not efficient at all, as changing tags usually means to remove all old tags and adding all new. The only problem here is: Old slugs for tags are not removed, because they're shared across all MediaTags and dropping orphans is not always easy.
* Move declarative_base Base into base.pyElrond2012-01-261-0/+4
| | | | The base class of all models "Base" should be in base.py.
* 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.
* Use custom query classElrond2012-01-201-1/+21
| | | | | | | | | A custom query class allows to add more methods on queries (read: "cursors"). This custom query class especially adds a .sort with a calling convention exactly like the mongo one. Makes a lot of existing code happy!
* Add a .save method on the sql db objectsElrond2011-12-291-1/+9
| | | | | | | | This is a shortcut to adding the object to a session (if needed) and giving a commit on the session. In reality, calling code should probably utilize the session on its own and call commit in an appropiate place.
* Support .get(fieldname) on sql db objectsElrond2011-12-291-0/+3
| | | | | | Some parts of the code like to call .get("somefield") on the db objects. It's easy to support this on sqlalchemy based objects, so lets do it.
* Improve .one() by using sqlalchemy's .one()Elrond2011-12-241-3/+1
|
* Add search level one() methodElrond2011-12-241-0/+13
| | | | And create a _fix_query_dict which converts '_id' to 'id'.
* SQL: mongokit like interfaceElrond2011-12-181-0/+16
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