1👍
Yh, you’ll get that error because the update method is available for only querysets.
So you can do this:
def editPlacementManager(request):
if request.method=='POST':
name=request.POST.get('name')
phone=request.POST.get('phone')
email=request.POST.get('email')
password=request.POST.get('password')
userid = request.POST.get('pmId')
user = User.objects.get(id=userid)
user.name = name
user.phone = phone
user.email = email
# You can continue with whichever field you want
user.save()
# Then finally you save the object with the updated fields
return redirect('listplacementmanager')
return render(request,"index/placementmanager.html")
- [Answered ]-Retrieve Json from request.FILES in Django without writing to file
- [Answered ]-Save dynamic page in Django
- [Answered ]-Testing celery task
- [Answered ]-Django url pattern issue in python 2.7.6
Source:stackexchange.com