def ds_update(request, pk, template_name='ds/ds_form.html'): crud = get_object_or_404(DService, pk=pk) form = DS_Form(request.POST or None, instance=crud) if form.is_valid(): form.save() return redirect('ds_home') return render(request, template_name, {'form': form})
def ds_update(request, pk, template_name="ds/ds_form.html"): crud = get_object_or_404(DService, pk=pk) form = DS_Form(request.POST or None, instance=crud) if form.is_valid(): form.save() return redirect("ds_home") return render(request, template_name, {"form": form})
def ds_create(request, template_name='ds/ds_form.html'): form = DS_Form(request.POST or None) if form.is_valid(): form.save() return redirect('ds_home') return render(request, template_name, {'form': form})
def ds_create(request, template_name="ds/ds_form.html"): form = DS_Form(request.POST or None) if form.is_valid(): form.save() return redirect("ds_home") return render(request, template_name, {"form": form})