Refactor Query.get() => Session.get() per SQLAlchemy 1.4

This commit is contained in:
Lance Edgar 2023-02-11 22:05:45 -06:00
parent 81aa0ae109
commit f611a5a521
38 changed files with 169 additions and 205 deletions

View file

@ -249,7 +249,7 @@ class EmployeeView(MasterView):
employee._stores.append(model.EmployeeStore(store_uuid=uuid))
for uuid in old_stores:
if uuid not in new_stores:
store = self.Session.query(model.Store).get(uuid)
store = self.Session.get(model.Store, uuid)
employee.stores.remove(store)
def update_departments(self, employee, data):
@ -262,7 +262,7 @@ class EmployeeView(MasterView):
employee._departments.append(model.EmployeeDepartment(department_uuid=uuid))
for uuid in old_depts:
if uuid not in new_depts:
dept = self.Session.query(model.Department).get(uuid)
dept = self.Session.get(model.Department, uuid)
employee.departments.remove(dept)
def get_possible_stores(self):