diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-02 17:01:43 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-02 17:01:43 -0500 |
commit | c0d532f04e91d97f92b06b15436140f704e8b8fe (patch) | |
tree | 973bdc2d90b01b12b792fb2cb98c7e173b7e8e3c | |
parent | 5d5eb6c3310ac7dea78a5788919a848dd3203616 (diff) | |
parent | 3f9d93407be1f719532ba2d1740ae38a6578449a (diff) | |
download | mediagoblin-c0d532f04e91d97f92b06b15436140f704e8b8fe.tar.lz mediagoblin-c0d532f04e91d97f92b06b15436140f704e8b8fe.tar.xz mediagoblin-c0d532f04e91d97f92b06b15436140f704e8b8fe.zip |
Merge remote branch 'remotes/elrond/idea/db_doc'
-rw-r--r-- | mediagoblin/db/__init__.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mediagoblin/db/__init__.py b/mediagoblin/db/__init__.py index c129cbf8..f0116083 100644 --- a/mediagoblin/db/__init__.py +++ b/mediagoblin/db/__init__.py @@ -13,3 +13,37 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. + +""" +Database Abstraction/Wrapper Layer +================================== + +This submodule is for most of the db specific stuff. + +There are two main ideas here: + +1. Open up a small possibility to replace mongo by another + db. This means, that all direct mongo accesses should + happen in the db submodule. While all the rest uses an + API defined by this submodule. + + Currently this API happens to be basicly mongo. + Which means, that the abstraction/wrapper layer is + extremely thin. + +2. Give the rest of the app a simple and easy way to get most of + their db needs. Which often means some simple import + from db.util. + +What does that mean? + +* Never import mongo directly outside of this submodule. + +* Inside this submodule you can do whatever is needed. The + API border is exactly at the submodule layer. Nowhere + else. + +* helper functions can be moved in here. They become part + of the db.* API + +""" |