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
This commit is contained in:
Elrond 2011-11-14 14:21:06 +01:00
parent a9c7af9040
commit 7cbddc96a8

View File

@ -63,6 +63,7 @@ class User(Document):
- bio_html: biography of the user converted to proper HTML. - bio_html: biography of the user converted to proper HTML.
""" """
__collection__ = 'users' __collection__ = 'users'
use_dot_notation = True
structure = { structure = {
'username': unicode, 'username': unicode,
@ -177,6 +178,7 @@ class MediaEntry(Document):
- fail_metadata: - fail_metadata:
""" """
__collection__ = 'media_entries' __collection__ = 'media_entries'
use_dot_notation = True
structure = { structure = {
'uploader': ObjectId, 'uploader': ObjectId,
@ -321,6 +323,7 @@ class MediaComment(Document):
""" """
__collection__ = 'media_comments' __collection__ = 'media_comments'
use_dot_notation = True
structure = { structure = {
'media_entry': ObjectId, 'media_entry': ObjectId,