Beispiel #1
0
 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})
Beispiel #2
0
 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})
Beispiel #3
0
 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})
Beispiel #4
0
 def get(self, request):
     form = ResourceForm()
     return render(request, 'szuspeech/manage-form.html', {'form': form})
Beispiel #5
0
 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})
Beispiel #6
0
 def get(self, request):
     resouce_id = request.GET.get('id')
     resource = get_object_or_404(Resource, id=resouce_id)
     form = ResourceForm(instance=resource)
     return render(request, 'szuspeech/manage-form.html', {'form': form})