Use SLQAlchemy ORM "relationship" instead of "relation"

"relation" was deprecated in SQLAlchemy 1.4 [1].

[1]https://docs.sqlalchemy.org/en/14/orm/relationship_api.html#sqlalchemy.orm.relation

Closes-Bug: #2004258
Change-Id: Ia37a178532860d52b2ed836f66b0f4ca73f8343c
This commit is contained in:
Rodolfo Alonso Hernandez 2023-01-25 03:45:26 +01:00
parent e6eeb700c8
commit 910574a5cc
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class RouterL3AgentBinding(model_base.BASEV2):
router_id = sa.Column(sa.String(36),
sa.ForeignKey("routers.id", ondelete='CASCADE'),
primary_key=True)
l3_agent = orm.relation(agent_model.Agent)
l3_agent = orm.relationship(agent_model.Agent)
l3_agent_id = sa.Column(sa.String(36),
sa.ForeignKey("agents.id", ondelete='CASCADE'),
primary_key=True)

View File

@ -33,7 +33,7 @@ class NetworkDhcpAgentBinding(model_base.BASEV2):
network_id = sa.Column(sa.String(36),
sa.ForeignKey("networks.id", ondelete='CASCADE'),
primary_key=True)
dhcp_agent = orm.relation(agent_model.Agent, lazy='subquery')
dhcp_agent = orm.relationship(agent_model.Agent, lazy='subquery')
dhcp_agent_id = sa.Column(sa.String(36),
sa.ForeignKey("agents.id",
ondelete='CASCADE'),