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
changes/71/872271/1
Rodolfo Alonso Hernandez 2 months ago
parent e6eeb700c8
commit 910574a5cc

@ -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)

@ -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'),

Loading…
Cancel
Save