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/edit/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/edit/views.py')
-rw-r--r-- | mediagoblin/edit/views.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index f3ebebe8..5f781552 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -57,7 +57,7 @@ def edit_media(request, media): existing_user_slug_entries = request.db.MediaEntry.find( {'slug': request.POST['slug'], 'uploader': media['uploader'], - '_id': {'$ne': media['_id']}}).count() + '_id': {'$ne': media._id}}).count() if existing_user_slug_entries: form.slug.errors.append( @@ -78,7 +78,7 @@ def edit_media(request, media): location=media.url_for_self(request.urlgen)) if request.user['is_admin'] \ - and media['uploader'] != request.user['_id'] \ + and media['uploader'] != request.user._id \ and request.method != 'POST': messages.add_message( request, messages.WARNING, @@ -104,7 +104,7 @@ def edit_attachments(request, media): attachment_public_filepath \ = mg_globals.public_store.get_unique_filepath( - ['media_entries', unicode(media['_id']), 'attachment', + ['media_entries', unicode(media._id), 'attachment', secure_filename(request.POST['attachment_file'].filename)]) attachment_public_file = mg_globals.public_store.get_file( |