Accessing base class variable [duplicate]
问题 This question already has an answer here : Accessing a mixin member variable (column) from the child (1 answer) Closed last year . How do I access id from my child class? class BaseClass: id = 'testing' class MyClass(BaseClass): something = id More specifically, I can't access id from class:User : class BaseModel: id = db.Column(db.Integer, primary_key=True) class User(db.Model, BaseModel): username = db.Column(db.String(35), nullable=False, unique=True) followed = db.relationship( 'User',