In Django, I am trying to modify the title of the existing book with id. My views.py file consists of
b=Books.objects.filter(book_id__iexact=book)
b.title = "Narnia"
b.save()
I am getting error and unable to save the model instance.
>Solution :
Try using get method instead of filter. When you use filter you are using a queryset object. Instead of using Books.objects.filter(book_id__iexact=book) try using b=Books.objects.get(book_id__iexact=book)