| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The base class of all models "Base" should be in base.py.
|
|
|
|
|
|
| |
Nearly all the sql files missed a copyright header.
So added it!
And while there fixed a few pep8 things.
|
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
And create a _fix_query_dict which converts '_id' to 'id'.
|
|
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
|