lazy=joined for Device.owner
This commit is contained in:
parent
c94e07fbac
commit
143e9a9fa9
2 changed files with 6 additions and 5 deletions
|
@ -56,6 +56,9 @@ class Device(DeviceRead, table=True):
|
||||||
# might be a future problem?
|
# might be a future problem?
|
||||||
owner: User = Relationship(
|
owner: User = Relationship(
|
||||||
back_populates="devices",
|
back_populates="devices",
|
||||||
|
sa_relationship_kwargs={
|
||||||
|
"lazy": "joined",
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -301,11 +301,9 @@ if __name__ == "__main__":
|
||||||
Connection.connect(current_config.db.uri)
|
Connection.connect(current_config.db.uri)
|
||||||
|
|
||||||
if (device := Device.get(1)) is not None:
|
if (device := Device.get(1)) is not None:
|
||||||
with Connection.session as db:
|
client = easy_rsa.issue(
|
||||||
db.add(device)
|
|
||||||
dn=DistinguishedName.build(device)
|
dn=DistinguishedName.build(device)
|
||||||
|
)
|
||||||
client = easy_rsa.issue(dn=dn)
|
|
||||||
|
|
||||||
for cert in (ca, server, client):
|
for cert in (ca, server, client):
|
||||||
if cert is not None:
|
if cert is not None:
|
||||||
|
|
Loading…
Reference in a new issue