#NEWLINE# def post( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# content = request . POST . get ( 'content' , '' ) #NEWLINE# markup = request . POST . get ( 'markup' ) #NEWLINE# reader = get_reader ( markup = markup ) #NEWLINE# ( content_body , metadata ) = reader ( content ) . read ( ) #NEWLINE# image_id = metadata . get ( 'image' , '' ) #NEWLINE# try : #NEWLINE# #INDENT# image_url = EntryImage . objects . get ( id = int ( image_id ) ) . image . url #NEWLINE# #UNINDENT# except ( EntryImage . DoesNotExist , ValueError ) : #NEWLINE# #INDENT# image_url = '' #NEWLINE# #UNINDENT# context = { #NEWLINE# #INDENT# 'content' : self , #NEWLINE# 'title' : metadata . get ( 'title' ) , #NEWLINE# 'tags' : list ( metadata . get ( 'tags' , [ ] ) ) , #NEWLINE# 'image_url' : image_url , #NEWLINE# #UNINDENT# } #NEWLINE# return self . render_to_response ( context )