1👍
✅
Needed to pass only 1 object to the instance
owner = owners[0]
then
instance=owner
However, I am only able to add/edit pet names 1 owner at a time.
Thanks aamir for the help!
0👍
I believe your error is in the second line of the views.py
file. I believe it is the call to the get_object_or_404
method causing the error when you try to specify teacher.id
in your template. The call to the get_object_or_404
method is returning more than one row from the database, so calling teacher.id
is not possible on it from more than one row.
- [Answer]-Is there Django view decorator to check a condition that doesn't assume the input is a User?
- [Answer]-Using variables in Django model content
Source:stackexchange.com