aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-11-14 14:21:06 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-11-15 11:32:13 +0100
commit7cbddc96a85410c14583b598312e40efe6051a44 (patch)
tree83c922eeb3af43d3efc08ef9cccede4917824ca0
parenta9c7af90408c3537f42763e63862a2ae44bcc368 (diff)
downloadmediagoblin-7cbddc96a85410c14583b598312e40efe6051a44.tar.lz
mediagoblin-7cbddc96a85410c14583b598312e40efe6051a44.tar.xz
mediagoblin-7cbddc96a85410c14583b598312e40efe6051a44.zip
Enable mongokit's "Dot notation"
mongokit documents can allow to use x.FIELD instead of x["FIELD"]. First it looks a lot more pythonic. Second it might allow us an easier migration path towards an sqlalchemy database backend. Docs: http://namlook.github.com/mongokit/tutorial.html#dot-notation
-rw-r--r--mediagoblin/db/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index c010cb89..65c15917 100644
--- a/mediagoblin/db/models.py
+++ b/mediagoblin/db/models.py
@@ -63,6 +63,7 @@ class User(Document):
- bio_html: biography of the user converted to proper HTML.
"""
__collection__ = 'users'
+ use_dot_notation = True
structure = {
'username': unicode,
@@ -177,6 +178,7 @@ class MediaEntry(Document):
- fail_metadata:
"""
__collection__ = 'media_entries'
+ use_dot_notation = True
structure = {
'uploader': ObjectId,
@@ -321,6 +323,7 @@ class MediaComment(Document):
"""
__collection__ = 'media_comments'
+ use_dot_notation = True
structure = {
'media_entry': ObjectId,