Dot-Notation for MediaEntry.media_type
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 4 Dec 2011 19:16:01 +0000 (20:16 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 5 Dec 2011 20:08:58 +0000 (21:08 +0100)
mediagoblin/processing.py
mediagoblin/submit/views.py
mediagoblin/user_pages/views.py

index 89c4ac89f190a4cadecf468f12a1eb6558481cdf..7dd5cc7dacf06f47eae3ec075761253d2c279617 100644 (file)
@@ -55,8 +55,8 @@ class ProcessMedia(Task):
 
         # Try to process, and handle expected errors.
         try:
-            #__import__(entry['media_type'])
-            manager = get_media_manager(entry['media_type'])
+            #__import__(entry.media_type)
+            manager = get_media_manager(entry.media_type)
             manager['processor'](entry)
         except BaseProcessingFail, exc:
             mark_entry_failed(entry._id, exc)
index 8da71341d3e8437753f2c6a1be47a6024fccf94a..4e4c7c43f824c6d96784ed6516c20817b52ad6b4 100644 (file)
@@ -55,7 +55,7 @@ def submit_start(request):
                 # create entry and save in database
                 entry = request.db.MediaEntry()
                 entry['_id'] = ObjectId()
-                entry['media_type'] = unicode(media_type)
+                entry.media_type = unicode(media_type)
                 entry.title = (
                     unicode(request.POST['title'])
                     or unicode(splitext(filename)[0]))
index dc5495679d27fa070fb14c361a0f5e4f86cf76f2..87b82c7487045ccd60e5b4c4592c4cfb580b2827 100644 (file)
@@ -122,7 +122,7 @@ def media_home(request, media, page, **kwargs):
 
     comment_form = user_forms.MediaCommentForm(request.POST)
 
-    media_template_name = get_media_manager(media['media_type'])['display_template']
+    media_template_name = get_media_manager(media.media_type)['display_template']
 
     return render_to_response(
         request,