Refactor Query.get()
=> Session.get()
per SQLAlchemy 1.4
This commit is contained in:
parent
81aa0ae109
commit
f611a5a521
38 changed files with 169 additions and 205 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue