diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-12-25 16:01:59 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-02-25 14:10:57 +0100 |
commit | 58f96a13e463fb417968cc92ec2ac5d4404641e4 (patch) | |
tree | a213ee4c35b23e4722d3e38baf209abf9bd755d4 /mediagoblin/submit/views.py | |
parent | 98913512561e10d409e1cce067b4ed42b72e337c (diff) | |
download | mediagoblin-58f96a13e463fb417968cc92ec2ac5d4404641e4.tar.lz mediagoblin-58f96a13e463fb417968cc92ec2ac5d4404641e4.tar.xz mediagoblin-58f96a13e463fb417968cc92ec2ac5d4404641e4.zip |
Allow .id instead of ._id for the Mongo backend
To allow easier migration to the SQLAlchemy style .id give
the User and MediaEntry mongo classes an alias attribute of
.id that maps to ['_id'].
Use it in the upload process, because this was one of the
last positions with a ['_id'] instead of ._id (due to a bug
in mongokit).
Diffstat (limited to 'mediagoblin/submit/views.py')
-rw-r--r-- | mediagoblin/submit/views.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index df5b15c0..1e145e9d 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -59,7 +59,7 @@ def submit_start(request): # create entry and save in database entry = request.db.MediaEntry() - entry['_id'] = ObjectId() + entry.id = ObjectId() entry.media_type = unicode(media_type) entry.title = ( unicode(request.POST['title']) |