You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the way __table_cls__ is deciding to create a table, we get the wrong error message when a tablename is generated for a non-inheriting model with no primary key.
classUser(db.Model):
pass
Error is:
sqlalchemy.exc.InvalidRequestError: Class <class '__main__.User'> does not have a __table__ or __tablename__ specified and does not inherit from an existing table-mapped class.
Error should be:
sqlalchemy.exc.ArgumentError: Mapper Mapper|User|user could not assemble any primary key columns for mapped table 'user'
The text was updated successfully, but these errors were encountered:
Possible solution: add a check after primary key loop to see if a base class is a mapped model and if not, create the table anyway, instead of unconditionally deleting the name.
Due to the way
__table_cls__
is deciding to create a table, we get the wrong error message when a tablename is generated for a non-inheriting model with no primary key.Error is:
Error should be:
The text was updated successfully, but these errors were encountered: