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?
|
||||
owner: User = Relationship(
|
||||
back_populates="devices",
|
||||
sa_relationship_kwargs={
|
||||
"lazy": "joined",
|
||||
},
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -301,11 +301,9 @@ if __name__ == "__main__":
|
|||
Connection.connect(current_config.db.uri)
|
||||
|
||||
if (device := Device.get(1)) is not None:
|
||||
with Connection.session as db:
|
||||
db.add(device)
|
||||
client = easy_rsa.issue(
|
||||
dn=DistinguishedName.build(device)
|
||||
|
||||
client = easy_rsa.issue(dn=dn)
|
||||
)
|
||||
|
||||
for cert in (ca, server, client):
|
||||
if cert is not None:
|
||||
|
|
Loading…
Reference in a new issue