Add DB Mixin classes and use them
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Wed, 4 Jan 2012 23:18:17 +0000 (00:18 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 8 Jan 2012 20:55:46 +0000 (21:55 +0100)
commitf42e49c3ad1c446e7899e7b76cd7fa381d5bba7c
treeafe23990c6bcff4566474e6c075eb81d4562adae
parentbcd50908d2849dff5a466b15db65112779cb85e2
Add DB Mixin classes and use them

A bunch of functions on the db objects are really more like
"utility functions": They could live outside the classes
and be called "by hand" passing the appropiate reference.
They usually only use the public API of the object and
rarely use database related stuff.

Goals:
- First, simple: Share the code with the SQL objects, so
  that the code doesn't need to be duplicated.
- Second, it might unclutter the db models and make them
  more into "model only" stuff.
- Doesn't really hurt.
mediagoblin/db/mixin.py [new file with mode: 0644]
mediagoblin/db/mongo/models.py
mediagoblin/db/sql/models.py