def post(self, request): resource_id = request.GET.get('id') resource = get_object_or_404(Resource, pk=resource_id) form = ResourceForm(request.POST,request.FILES,instance=resource) if form.is_valid(): form.save() return HttpResponseRedirect(reverse("szuspeech:manage_list")) return render(request,'szuspeech/manage-form.html',{'form':form})
def post(self, request): resource_id = request.GET.get('id') resource = get_object_or_404(Resource, pk=resource_id) form = ResourceForm(request.POST, request.FILES, instance=resource) if form.is_valid(): form.save() return HttpResponseRedirect(reverse("szuspeech:manage_list")) return render(request, 'szuspeech/manage-form.html', {'form': form})
def post(self, request): form = ResourceForm(request.POST, request.FILES) if form.is_valid(): form.save() return HttpResponseRedirect(reverse("szuspeech:manage_list")) return render(request, 'szuspeech/manage-form.html', {'form':form})
def post(self, request): form = ResourceForm(request.POST, request.FILES) if form.is_valid(): form.save() return HttpResponseRedirect(reverse("szuspeech:manage_list")) return render(request, 'szuspeech/manage-form.html', {'form': form})