#NEWLINE# @ login_required #NEWLINE# @ permission_required ( 'namer.change_network' , login_url = '/login/' ) #NEWLINE# def edit_network( request , network_id ) : #NEWLINE# #INDENT# network = get_object_or_404 ( Network , pk = network_id ) #NEWLINE# c = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# c . update ( csrf ( network ) ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = NetworkForm ( request . POST , instance = network ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# the_network = form . save ( commit = False ) #NEWLINE# the_network . save ( ) #NEWLINE# return redirect ( 'namer.views.show_network' , network . computergroup . id ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = NetworkForm ( instance = network ) #NEWLINE# #UNINDENT# c = { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# 'group' : network . computergroup , #NEWLINE# 'network' : network , #NEWLINE# #UNINDENT# } #NEWLINE# return render_to_response ( 'forms/edit_network.html' , c , context_instance = RequestContext ( request ) )