Flask-Middleware / flask-security

Quick and simple security for Flask applications
MIT License
624 stars 155 forks source link

Docs: set_db_info #888

Closed sr-verde closed 5 months ago

sr-verde commented 7 months ago

The Basic SQLAlchemy Application quickstart tells us to use fsqla.FsModels.set_db_info(db). But I cannot find any documentation about the purpose of this function. On other places in the docs [1], [2], [3], [4] I cannot find this function be used. The docstring tells us This needs to be called after the DB object has been created.

My question: Is this function call really needed? Until now, my code works well without it. And: Should it be added to the other quickstart examples as well?

jwag956 commented 7 months ago

I'll work on the docs - the simple answer is - this is ONLY necessary if you use the provided fsqla models. If you declare your own models then your model code has the equivalent code. set_db_info is just needed to glue together the fsqla models.

As per your examples - none of those use the fsqla models.

sr-verde commented 7 months ago

Yes, in the meantime, I also came to this assumption. Yes, in the meantime, I also came to this assumption. I'm currently trying to integrate the "new" dataclasses support into my models and am looking for the cause of some problems. That's why I came across these lines in the docs.