Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upProvide documentation for using reflect #705
Comments
|
Soooo...what are you looking for here? You want In that case, I believe AutoMap is what you want and specifically automap_base. I've not tried this code, but it might be as simple as: AutoMapModel = automap_base(db.Model)
class Feed(AutoMapModel):
__tablename__ = 'autofeeds'
AutoMapModel.prepare(db.engine, reflect=True)Let me know. If it works or you can give me the version that works, I don't see any reason why we can't add it to the docs. |
|
We generally don't add docs for things that are documented by SQLAlchemy unless they have different behavior. Is there something specific to Flask-SQLAlchemy here? We do provide |
|
I think the thing that is causing confusion, and may be worth documenting, is that unlike traditional SA, we "hide" the With pure SA, you'd swap your usage of |
|
We already have some documentation on the metaclass: http://flask-sqlalchemy.pocoo.org/2.3/customizing/#model-metaclass. We also document |
I've searched high and low trying to find a flask-sqlalchemy reflect example that actually works.
There seem to be others with the same issue (via stack overflow) who are frustrated. I'm sure you're tired of having to troubleshoot for users as well. :-(
I'd be happy to write up the doc if you could provide a working example (using an app factory and without).
Here's what I've come up with thus far only to be hit with this error:
app.py
src/extensions.py
src/models.py