Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Flask SQLAlchemy Integration - Documentation Suggestion #143
Firstly, thank you for the great extension!!
I've ran into an error that I'm sure others will have ran into, it may be worth updating the docs with a warning about it.
Our structure was as follows:
Some background - with SQLAlchemy, with separate models, you need to import them all at runtime, before the DB is initialised to avoid circular dependancies within relationships.
and, on subsequent loads:
The solution to this is to simply build the UserSchemas in a different import namespace, we've now got:
And no more circular issues - hopefully this helps someone else, went around in circles (pun intended) for a few hours before I realised it was the ModelSchema causing it.
Could the docs be updated to make a point of explaining that the ModelSchema initialises the model, and therefore it's a good idea for them to be in separate import destinations?