diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-11-13 19:25:06 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-11-15 11:32:13 +0100 |
commit | eabe6b678a98fd06d9cd8463935a3b842f41485c (patch) | |
tree | 9d8115df0629a5bbc9842c1616fed466371539e7 /mediagoblin/submit/views.py | |
parent | 7cbddc96a85410c14583b598312e40efe6051a44 (diff) | |
download | mediagoblin-eabe6b678a98fd06d9cd8463935a3b842f41485c.tar.lz mediagoblin-eabe6b678a98fd06d9cd8463935a3b842f41485c.tar.xz mediagoblin-eabe6b678a98fd06d9cd8463935a3b842f41485c.zip |
Dot-Notation for "_id"
Note: Migrations can't use "Dot Notation"!
Migrations run on pymongo, not mongokit.
So they can't use the "Dot Notation".
This isn't really a big issue, as migrations are anyway
quite mongo specific.
Diffstat (limited to 'mediagoblin/submit/views.py')
-rw-r--r-- | mediagoblin/submit/views.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index 25f7d79d..bd63bd18 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -52,7 +52,7 @@ def submit_start(request): # create entry and save in database entry = request.db.MediaEntry() - entry['_id'] = ObjectId() + entry._id = ObjectId() entry['title'] = ( unicode(request.POST['title']) or unicode(splitext(filename)[0])) @@ -62,7 +62,7 @@ def submit_start(request): entry['description']) entry['media_type'] = u'image' # heh - entry['uploader'] = request.user['_id'] + entry['uploader'] = request.user._id # Process the user's folksonomy "tags" entry['tags'] = convert_to_tag_list_of_dicts( @@ -74,7 +74,7 @@ def submit_start(request): # Now store generate the queueing related filename queue_filepath = request.app.queue_store.get_unique_filepath( ['media_entries', - unicode(entry['_id']), + unicode(entry._id), secure_filename(filename)]) # queue appropriately @@ -105,7 +105,7 @@ def submit_start(request): # conditions with changes to the document via processing code) try: process_media.apply_async( - [unicode(entry['_id'])], {}, + [unicode(entry._id)], {}, task_id=task_id) except BaseException as exc: # The purpose of this section is because when running in "lazy" @@ -116,7 +116,7 @@ def submit_start(request): # # ... not completely the diaper pattern because the # exception is re-raised :) - mark_entry_failed(entry[u'_id'], exc) + mark_entry_failed(entry._id, exc) # re-raise the exception raise |