[openstack-dev] [Neutron] need help in translating sql query to sqlalchemy query

Sean M. Collins sean at coreitpro.com
Tue Dec 1 13:05:56 UTC 2015


Consult the API:

http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.query.Query.join

In fact, there is already one join happening a couple lines above your
change:

https://github.com/openstack/neutron/blob/stable/liberty/neutron/db/l3_db.py#L800

Most likely, you will also need to use the aliased() function - since
there are some examples that are similar to what you are trying to do -
check out the "Joins to a Target with an ON Clause" section in the first
link.

http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.aliased

-- 
Sean M. Collins



More information about the OpenStack-dev mailing list