#NEWLINE# @ app . route ( '/new_post' , methods = [ 'POST' , 'GET' ] ) #NEWLINE# def create_post( ) : #NEWLINE# #INDENT# if ( app . request . method == 'GET' ) : #NEWLINE# #INDENT# return app . render ( 'editor.html' ) #NEWLINE# #UNINDENT# title = app . request . form [ 'title' ] #NEWLINE# tags = tag_filter ( app . request . form [ 'tag' ] ) #NEWLINE# content = app . request . form [ 'editor' ] #NEWLINE# post = Post ( title = title , content = content , pub_date = datetime . now ( ) ) #NEWLINE# db . add ( post ) #NEWLINE# db . commit ( ) #NEWLINE# for i in title : #NEWLINE# #INDENT# post . tags . append ( i ) #NEWLINE# #UNINDENT# print ( app . url_for ( show_post , id = post . id ) ) #NEWLINE# return app . redirect ( app . url_for ( show_post , id = post . id ) )