flask-sqlalchemy icon indicating copy to clipboard operation
flask-sqlalchemy copied to clipboard

Incorrect(?) example in documentation

Open haa-zee opened this issue 1 year ago • 0 comments

Environment:

  • Python version: 3.x
  • Flask-SQLAlchemy version: 3.1.x
  • SQLAlchemy version: N/A I found a possibly incorrect example in the Reflecting Tables section of docs/models.rst There is a class definistion:

class User:
    __table__ = db.metadatas["auth"].tables["user"]

As far as I know it doesn't work, because the parent class is missing from it. The correct definition would be

class User(Base):
    __table__ = db.metadatas["auth"].tables["user"]

Of course, I may have misunderstood something.

haa-zee avatar Nov 22 '23 08:11 haa-zee