From f4ee839939e4215820df3132b62c51f721510f77 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 4 Dec 2011 20:16:01 +0100 Subject: [PATCH] Dot-Notation for MediaEntry.media_type --- mediagoblin/processing.py | 4 ++-- mediagoblin/submit/views.py | 2 +- mediagoblin/user_pages/views.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mediagoblin/processing.py b/mediagoblin/processing.py index 89c4ac89..7dd5cc7d 100644 --- a/mediagoblin/processing.py +++ b/mediagoblin/processing.py @@ -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) diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index 8da71341..4e4c7c43 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -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])) diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index dc549567..87b82c74 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -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, -- 2.25.1