@require_role('admin')
def idc_edit(request):
 (header_title, path1, path2) = (u'\u7f16\u8f91IDC', u'\u8d44\u4ea7\u7ba1\u7406', u'\u7f16\u8f91IDC')
 idc_id = request.GET.get('id', '')
 idc = get_object(IDC, id=idc_id)
 if (request.method == 'POST'):
  idc_form = IdcForm(request.POST, instance=idc)
  if idc_form.is_valid():
   idc_form.save()
   return HttpResponseRedirect(reverse('idc_list'))
 else:
  idc_form = IdcForm(instance=idc)
  return my_render('jasset/idc_edit.html', locals(), request)

@ require_role ( 'admin' ) def idc_edit ( request ) : ( header_title , path1 , path2 ) = ( u'\u7f16\u8f91IDC' , u'\u8d44\u4ea7\u7ba1\u7406' , u'\u7f16\u8f91IDC' ) idc_id = request . GET . get ( 'id' , '' ) idc = get_object ( IDC , id = idc_id ) if ( request . method == 'POST' ) : idc_form = IdcForm ( request . POST , instance = idc ) if idc_form . is_valid ( ) : idc_form . save ( ) return HttpResponseRedirect ( reverse ( 'idc_list' ) ) else : idc_form = IdcForm ( instance = idc ) return my_render ( 'jasset/idc_edit.html' , locals ( ) , request )
idc edit view .