librelist archives

« back to archive

Flask-SQLAlchemy not propegating session options

Flask-SQLAlchemy not propegating session options

From:
Sjoerd Huisman | Congressus
Date:
2013-01-03 @ 21:11
Hi,

 

I have implemented a new Query-Class that extends and partly overrides the
Flask-SQLAlchemy BaseQuery. This is initialised as follows;

db = SQLAlchemy(session_options={'query_cls':ClientQuery})

 

This prefiltering query class works when I apply the following pattern;

db.session.Query(someObject).filter(someFilter)

 

But not when I use the following

someObject.Query.filter(someFilter)

 

The someObject extends the db.Model class from Flask-Alchemy. Hope someone
can help.

 

Thanks!