I’m using SQLAlchemy 1.0.12. When I have an instance of my model & assign a new value to an attribute, I get a
tuple instead of the value.
type(self.address1) <class 'tuple'>
This wreaks a bit of havoc when I try to use
marshmallow-sqlalchemy 0.8.1 to do a
The assigned basically doesn’t show up in the dumped data because it doesn’t know how to marshal a
tuple. The only way to “flatten” the tuple/attributes is to do a
session.commit() before doing a
Is there a cleaner way? I have other instances to change/create before I want to do a
It was a user error. I accidentally had a comma at the end of an assignment, and python created a tuple as the return value.
This returns an integer
This returns a tuple
Removing the comma in my
return statement as suggested in the comments by Ilja worked