Refactor Query.get()
=> Session.get()
per SQLAlchemy 1.4
This commit is contained in:
parent
eaaf437568
commit
816874cc84
|
@ -342,7 +342,7 @@ class ExportableInvoiceView(MasterView):
|
||||||
|
|
||||||
invoices = []
|
invoices = []
|
||||||
for uuid in uuids:
|
for uuid in uuids:
|
||||||
invoice = self.Session.query(model.QuickbooksExportableInvoice).get(uuid)
|
invoice = self.Session.get(model.QuickbooksExportableInvoice, uuid)
|
||||||
if invoice and self.exportable(invoice):
|
if invoice and self.exportable(invoice):
|
||||||
invoices.append(invoice)
|
invoices.append(invoice)
|
||||||
if not invoices:
|
if not invoices:
|
||||||
|
@ -370,7 +370,7 @@ class ExportableInvoiceView(MasterView):
|
||||||
|
|
||||||
invoices = []
|
invoices = []
|
||||||
for uuid in uuids:
|
for uuid in uuids:
|
||||||
invoice = self.Session.query(model.QuickbooksExportableInvoice).get(uuid)
|
invoice = self.Session.get(model.QuickbooksExportableInvoice, uuid)
|
||||||
if invoice and self.exportable(invoice):
|
if invoice and self.exportable(invoice):
|
||||||
invoices.append(invoice)
|
invoices.append(invoice)
|
||||||
if not invoices:
|
if not invoices:
|
||||||
|
@ -399,7 +399,7 @@ class ExportableInvoiceView(MasterView):
|
||||||
|
|
||||||
invoices = []
|
invoices = []
|
||||||
for uuid in selected:
|
for uuid in selected:
|
||||||
invoice = self.Session.query(model.QuickbooksExportableInvoice).get(uuid)
|
invoice = self.Session.get(model.QuickbooksExportableInvoice, uuid)
|
||||||
if invoice and invoice.status_code == invoice.STATUS_EXPORTABLE:
|
if invoice and invoice.status_code == invoice.STATUS_EXPORTABLE:
|
||||||
invoices.append(invoice)
|
invoices.append(invoice)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue