Dot-Notation for MediaEntry.media_type
This commit is contained in:
parent
1d93996604
commit
f4ee839939
@ -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)
|
||||
|
@ -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]))
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user