views:

86

answers:

1

With SQLAlchemy, is there a way to know beforehand whether a relation would be lazy-loaded?
For example, given a lazy parent->children relation and an instance X of "parent", I'd like to know if "X.children" is already loaded, without triggering the query.

+1  A: 

I think you could look at the child's __dict__ attribute dictionary to check if the data is already there or not.

Haes
It works, thanks :)
Joril