I need to get a list of a model\'s properties which are actually relationships (that is, they were created by relationship()).
relationship()
Say I have a model
You just need to use the inspect module from sqlalchemy
inspect
sqlalchemy
from sqlalchemy import inspect i = inspect(model) i.relationships
If you need the class of each referred model you can do:
referred_classes = [r.mapper.class_ for r in i.relationships]