eager-loading of associations relationship on IPAddress model
This commit is contained in:
parent
07c96b1973
commit
494a3a4ddc
@ -160,7 +160,8 @@ class IPAddress(BASEV2, models.HasId):
|
|||||||
address_type = sa.Column(sa.Enum(ip_types.FIXED, ip_types.FLOATING,
|
address_type = sa.Column(sa.Enum(ip_types.FIXED, ip_types.FLOATING,
|
||||||
ip_types.SHARED,
|
ip_types.SHARED,
|
||||||
name="quark_ip_address_types"))
|
name="quark_ip_address_types"))
|
||||||
associations = orm.relationship(PortIpAssociation, backref="ip_address")
|
associations = orm.relationship(PortIpAssociation, backref="ip_address",
|
||||||
|
lazy='subquery')
|
||||||
|
|
||||||
def enabled_for_port(self, port):
|
def enabled_for_port(self, port):
|
||||||
for assoc in self["associations"]:
|
for assoc in self["associations"]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user