#NEWLINE# @ login_required #NEWLINE# def render( request , model = None , id = None ) : #NEWLINE# #INDENT# if ( ( id is None ) and request . POST . has_key ( 'pk' ) ) : #NEWLINE# #INDENT# id = request . POST [ 'pk' ] #NEWLINE# #UNINDENT# if ( id is None ) : #NEWLINE# #INDENT# txt = entry_markup ( request . POST [ 'txt' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( model == 'draft' ) : #NEWLINE# #INDENT# obj = Draft . objects . get ( pk = id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( model == 'entry' ) : #NEWLINE# #INDENT# obj = Entry . objects . get ( pk = id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( model == 'project' ) : #NEWLINE# #INDENT# obj = Project . objects . get ( pk = id ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if obj . use_markdown : #NEWLINE# #INDENT# txt = entry_markup ( obj . body , obj ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# txt = obj . body #NEWLINE# #UNINDENT# #UNINDENT# return HttpResponse ( txt )