def edit(self, id):
<EOL>c.prefix = Prefix.get(int(id))<EOL>if request.method == '<STR_LIT:POST>':<EOL><INDENT>c.prefix.prefix = request.params['<STR_LIT>']<EOL>c.prefix.description = request.params['<STR_LIT>']<EOL>if request.params['<STR_LIT>'].strip() == '<STR_LIT>':<EOL><INDENT>c.prefix.node = None<EOL><DEDENT>else:<EOL><INDENT>c.prefix.node = request.params['<STR_LIT>']<EOL><DEDENT>if request.params['<STR_LIT>'].strip() == '<STR_LIT>':<EOL><INDENT>c.prefix.country = None<EOL><DEDENT>else:<EOL><INDENT>c.prefix.country = request.params['<STR_LIT>']<EOL><DEDENT>if request.params['<STR_LIT>'].strip() == '<STR_LIT>':<EOL><INDENT>c.prefix.comment = None<EOL><DEDENT>else:<EOL><INDENT>c.prefix.comment = request.params['<STR_LIT>']<EOL><DEDENT>if request.params['<STR_LIT>'].strip() == '<STR_LIT>':<EOL><INDENT>c.prefix.order_id = None<EOL><DEDENT>else:<EOL><INDENT>c.prefix.order_id = request.params['<STR_LIT>']<EOL><DEDENT>if request.params['<STR_LIT>'].strip() == '<STR_LIT>':<EOL><INDENT>c.prefix.customer_id = None<EOL><DEDENT>else:<EOL><INDENT>c.prefix.customer_id = request.params['<STR_LIT>']<EOL><DEDENT>if request.params['<STR_LIT>'].strip() == '<STR_LIT>':<EOL><INDENT>c.prefix.vrf = None<EOL><DEDENT>else:<EOL><INDENT>c.prefix.vrf = VRF.list({ '<STR_LIT>': request.params['<STR_LIT>'] })[<NUM_LIT:0>]<EOL><DEDENT>if request.params.get('<STR_LIT>') is not None:<EOL><INDENT>c.prefix.monitor = True<EOL><DEDENT>else:<EOL><INDENT>c.prefix.monitor = False<EOL><DEDENT>c.prefix.alarm_priority = request.params['<STR_LIT>']<EOL>c.prefix.save()<EOL>redirect(url(controller='<STR_LIT>', action='<STR_LIT:list>'))<EOL><DEDENT>return render('<STR_LIT>')<EOL>
Edit a prefix.