eve-sqlalchemy
eve-sqlalchemy copied to clipboard
DOC: Better documentation for using flask-sqlalchemy
The example from the docs doesn't make sense
from eve_sqlalchemy import SQL as _SQL
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy(app) # app is not defined yet
class SQL(_SQL):
driver = db
app = Eve(validator=ValidatorSQL, data=SQL)
When we create app
, it requires SQL
class, which requires db
which in turn requires app
which hasn't been defined yet.
There is also the "circular imports" issue. This caused my settings.py file to be bad, but the problem reported itself as DOMAIN dictionary missing or wrong
which is misleading since I did have a settings.py file(magic filename) and it it did have DOMAIN dict defined as per the example.
if eve-sqlalchemy already uses flask-sqlalchemy internally, then why the above section in the documentation ? Can you clarify ?
I would like to skip using flask_sqlalchemy
in the future cause it's a bit hard for people familiar with SQLAlachemy and not flask. I agree that the docs in that part are right now not consistent. I haven't got time to cleanup this part :(