Dot-Notation for MediaEntry.description(_html)
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 4 Dec 2011 19:06:42 +0000 (20:06 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 5 Dec 2011 20:08:58 +0000 (21:08 +0100)
mediagoblin/edit/views.py
mediagoblin/submit/views.py

index 51661a21afcbf8ac816235fc9808f7a662ddc08b..4cb98c15933f07a3f36bcb77676629535749ad6f 100644 (file)
@@ -45,7 +45,7 @@ def edit_media(request, media):
     defaults = dict(
         title=media.title,
         slug=media.slug,
-        description=media['description'],
+        description=media.description,
         tags=media_tags_as_string(media['tags']))
 
     form = forms.EditForm(
@@ -65,12 +65,12 @@ def edit_media(request, media):
                 _(u'An entry with that slug already exists for this user.'))
         else:
             media.title = unicode(request.POST['title'])
-            media['description'] = unicode(request.POST.get('description'))
+            media.description = unicode(request.POST.get('description'))
             media['tags'] = convert_to_tag_list_of_dicts(
                                    request.POST.get('tags'))
 
-            media['description_html'] = cleaned_markdown_conversion(
-                media['description'])
+            media.description_html = cleaned_markdown_conversion(
+                media.description)
 
             media.slug = unicode(request.POST['slug'])
             media.save()
index 1805e2939defb146f34f8600ff1c8b28d7592338..8da71341d3e8437753f2c6a1be47a6024fccf94a 100644 (file)
@@ -60,9 +60,9 @@ def submit_start(request):
                     unicode(request.POST['title'])
                     or unicode(splitext(filename)[0]))
 
-                entry['description'] = unicode(request.POST.get('description'))
-                entry['description_html'] = cleaned_markdown_conversion(
-                    entry['description'])
+                entry.description = unicode(request.POST.get('description'))
+                entry.description_html = cleaned_markdown_conversion(
+                    entry.description)
 
                 entry.uploader = request.user._id