mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2025-11-03 07:16:09 +00:00
main.py - added endpoint to release single lease
This commit is contained in:
@@ -115,6 +115,13 @@ class Lease(Base):
|
||||
session.close()
|
||||
return entities
|
||||
|
||||
@staticmethod
|
||||
def find_by_lease_ref(engine: Engine, lease_ref: str) -> "Lease":
|
||||
session = sessionmaker(bind=engine)()
|
||||
entity = session.query(Lease).filter(Lease.lease_ref == lease_ref).first()
|
||||
session.close()
|
||||
return entity
|
||||
|
||||
@staticmethod
|
||||
def find_by_origin_ref_and_lease_ref(engine: Engine, origin_ref: str, lease_ref: str) -> "Lease":
|
||||
session = sessionmaker(bind=engine)()
|
||||
|
||||
Reference in New Issue
Block a user