Quantcast
Channel: SQLAlchemy "AttributeError: 'str' object has no attribute 'c'" - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Akshay Salvi for SQLAlchemy "AttributeError: 'str' object has no...

class UserPermission(Base): __table__ = 'userPermissions'here should be :class UserPermission(Base): __tablename__ = 'userPermissions'

View Article



Answer by SuperShoot for SQLAlchemy "AttributeError: 'str' object has no...

In your UserPermission class, you are using the wrong dunder attribute:__table__ = 'userPermissions'Should be:__tablename__ = 'userPermissions'Sqlalchemy is trying to treat the string 'userPermissions'...

View Article

SQLAlchemy "AttributeError: 'str' object has no attribute 'c'"

I have two tables named users and permissions and I wanted to create a relationship between them using a table named userPermissions. here's how my code looks like:class User(Base): __tablename__ =...

View Article
Browsing all 3 articles
Browse latest View live


Latest Images