#NEWLINE# @ posse . route ( '/edit' , methods = [ 'GET' , 'POST' ] ) #NEWLINE# @ login_required #NEWLINE# def edit( ) : #NEWLINE# #INDENT# if ( request . method == 'GET' ) : #NEWLINE# #INDENT# target_id = request . args . get ( 'target_id' ) #NEWLINE# target = PosseTarget . query . get ( target_id ) #NEWLINE# return render_template ( 'posse/edit.jinja2' , target = target ) #NEWLINE# #UNINDENT# target_id = request . form . get ( 'target_id' ) #NEWLINE# target = PosseTarget . query . get ( target_id ) #NEWLINE# for prop in [ 'name' , 'style' , 'user_name' , 'user_url' , 'user_photo' , 'service_name' , 'service_url' , 'service_photo' ] : #NEWLINE# #INDENT# setattr ( target , prop , request . form . get ( prop ) ) #NEWLINE# #UNINDENT# db . session . commit ( ) #NEWLINE# return redirect ( url_for ( '.edit' , target_id = target_id ) )