daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. urlpatterns = [
  2.     path('bkb/', views.index, name = 'index'),
  3.     path('bkb/<int:department_code>/', views.lcdcl, name ='lcdcl'),
  4.     path('bkb/<int:department_code>/<int:cl_id>/', views.lcdcl2, name ='lcdcl2'),
  5.     path('bkb/addcl2/' , views.addcl2, name='addcl2'),
  6.     path('bkb/<int:department_code>/<int:cl_id>/<int:edit_id>/edit/', views.editdata, name ='editdata'),
  7.     path('bkb/<int:dept_code>/<int: id>/revers/', views.revers, name ='revers'),
  8.    
  9. def editdata(request, department_code, cl_id, edit_id):
  10.     editdata = CL2.objects.get(pk=edit_id)
  11.     cl2_info = LCD.objects.get(pk=cl_id)
  12.     a = department_code
  13.     b = cl_id
  14.     if request.method == "POST":
  15.         forms = CL2Form(request.POST, instance=editdata)
  16.         if forms.is_valid():
  17.             editdata = forms.save(commit=False)
  18.             editdata.save()
  19.  
  20.          return redirect('/bkb/lcdcl2/')
  21.     else:
  22.         forms = CL2Form(instance=editdata)
  23.         context = {'forms' : forms}
  24.     return render(request, 'bkb/lcdcl2form.html', context)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top