Added Markdown rendering for media_entry

This commit is contained in:
Joar Wandborg
2011-06-12 03:24:31 +02:00
parent d07713d0b0
commit 44e2da2fe6
7 changed files with 24 additions and 7 deletions

View File

@@ -48,6 +48,13 @@ def submit_start(request):
entry = request.db.MediaEntry()
entry['title'] = request.POST['title'] or unicode(splitext(filename)[0])
entry['description'] = request.POST.get('description')
import markdown
md = markdown.Markdown(
safe_mode = 'escape')
entry['description_html'] = md.convert(
entry['description'])
entry['media_type'] = u'image' # heh
entry['uploader'] = request.user['_id']