[Django]-Attribute error method object has no attribute

4👍

item = Item.objects.get(id=id)
                      ^^^
# id = field_name of primary key in your model as string ('id' on default)
# id  = your local variable 'id' from function signature
👤Max M

Leave a comment