Hi all
I am working on Django Update operation in CRUD . I used this code
Please help me
Thank you in advance for your help!
I am working on Django Update operation in CRUD . I used this code
def update_receipe(request,id):
queryset = Receipe.objects.get(id = id)
if request.method == "POST":
data = request.POST
receipe_name = data.get('receipe_name')
receipe_description = data.get('receipe_description')
receipe_image = request.FILES.get('receipe_image')
queryset.receipe_name == receipe_name
queryset.receipe_description == receipe_description
if receipe_image:
queryset.receipe_image == receipe_image
queryset.save()
return redirect('/receipes/')
return render(request,'update_receipes.html',{'receipe':queryset}) I am not getting updated value in home page it is showing unupdated value.Please help me
Thank you in advance for your help!
buran write Mar-18-2024, 07:47 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
