SQLalchemy AttributeError: ‘str’ object has no attribute ‘_sa_instance_state’

I think the problem is in how you are defining the related company schema:

JawboneUP3 = item(itemID = "1", name = "Jawbone UP3", description = "The latest UP!", 
                  category = "tracker", price = "$174.99", company = "Jawbone")
                                                           # HERE^

The item constructor expects a company instance but you are passing a string value. Fix it:

JawboneUP3 = item(itemID="1", 
                  name="Jawbone UP3", 
                  description="The latest UP!", 

Leave a Comment