#NEWLINE# @ allow_build #NEWLINE# def build_edit( request , id ) : #NEWLINE# #INDENT# system = get_object_or_404 ( models . System , pk = id , allocation__name = 'release' ) #NEWLINE# try : #NEWLINE# #INDENT# build_attribute = system . buildattribute #NEWLINE# #UNINDENT# except models . BuildAttribute . DoesNotExist : #NEWLINE# #INDENT# build_attribute = None #NEWLINE# #UNINDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = BuildAttributeForm ( request . POST , instance = build_attribute ) #NEWLINE# system_form = BuildSystemForm ( request . POST , instance = system ) #NEWLINE# if ( form . is_valid ( ) and system_form . is_valid ( ) ) : #NEWLINE# #INDENT# system_form . save ( ) #NEWLINE# ba = form . save ( commit = False ) #NEWLINE# ba . system = system #NEWLINE# ba . save ( ) #NEWLINE# form . save_m2m ( ) #NEWLINE# return redirect ( build_list ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = BuildAttributeForm ( instance = build_attribute ) #NEWLINE# system_form = BuildSystemForm ( instance = system ) #NEWLINE# #UNINDENT# return render_to_response ( 'build/edit.html' , { #NEWLINE# #INDENT# 'systems' : system , #NEWLINE# 'system_form' : system_form , #NEWLINE# 'form' : form , #NEWLINE# #UNINDENT# } , RequestContext ( request ) )