get_with_indexed_value is now an iterator (#23551)
This commit is contained in:
parent
dadd54bca8
commit
51889bd567
|
@ -123,7 +123,8 @@ def synchronize_domino(publisher):
|
||||||
if getattr(payment_invoice, 'domino_knows_its_paid', None) or getattr(payment_invoice, 'paid_by_domino', None):
|
if getattr(payment_invoice, 'domino_knows_its_paid', None) or getattr(payment_invoice, 'paid_by_domino', None):
|
||||||
# synchronization of payment already done, skip
|
# synchronization of payment already done, skip
|
||||||
continue
|
continue
|
||||||
transactions = Transaction.get_with_indexed_value('invoice_ids', payment_invoice.id)
|
transactions = list(Transaction.get_with_indexed_value('invoice_ids',
|
||||||
|
payment_invoice.id))
|
||||||
if not transactions:
|
if not transactions:
|
||||||
logger.warning("domino cron: invoice %s is marked paid but does "
|
logger.warning("domino cron: invoice %s is marked paid but does "
|
||||||
"not have any linked transaction.", payment_invoice.id)
|
"not have any linked transaction.", payment_invoice.id)
|
||||||
|
|
|
@ -136,8 +136,8 @@ class StrongboxDirectory(Directory):
|
||||||
|
|
||||||
# TODO: a paragraph of explanations here could be useful
|
# TODO: a paragraph of explanations here could be useful
|
||||||
|
|
||||||
sffiles = StrongboxItem.get_with_indexed_value(
|
sffiles = list(StrongboxItem.get_with_indexed_value(
|
||||||
str('user_id'), str(get_request().user.id))
|
str('user_id'), str(get_request().user.id)))
|
||||||
if sffiles:
|
if sffiles:
|
||||||
r += htmltext('<table id="strongbox-items">')
|
r += htmltext('<table id="strongbox-items">')
|
||||||
r += htmltext('<tr><th></th><th>%s</th><th>%s</th><th></th></tr>') % (
|
r += htmltext('<tr><th></th><th>%s</th><th>%s</th><th></th></tr>') % (
|
||||||
|
@ -332,8 +332,8 @@ class StrongboxDirectory(Directory):
|
||||||
return self.picked_file()
|
return self.picked_file()
|
||||||
r = TemplateIO(html=True)
|
r = TemplateIO(html=True)
|
||||||
root_url = get_publisher().get_root_url()
|
root_url = get_publisher().get_root_url()
|
||||||
sffiles = StrongboxItem.get_with_indexed_value(
|
sffiles = list(StrongboxItem.get_with_indexed_value(
|
||||||
str('user_id'), str(get_request().user.id))
|
str('user_id'), str(get_request().user.id)))
|
||||||
r += htmltext('<h2>%s</h2>') % _('Pick a file')
|
r += htmltext('<h2>%s</h2>') % _('Pick a file')
|
||||||
|
|
||||||
if not sffiles:
|
if not sffiles:
|
||||||
|
|
|
@ -360,8 +360,8 @@ class RegieDirectory(Directory):
|
||||||
|
|
||||||
def get_invoices(self):
|
def get_invoices(self):
|
||||||
sort_by = self.get_sort_by()
|
sort_by = self.get_sort_by()
|
||||||
invoices = Invoice.get_with_indexed_value('regie_id', self.regie.id,
|
invoices = list(Invoice.get_with_indexed_value('regie_id', self.regie.id,
|
||||||
ignore_errors=True)
|
ignore_errors=True))
|
||||||
if 'date' in sort_by:
|
if 'date' in sort_by:
|
||||||
reverse = True
|
reverse = True
|
||||||
key = lambda i: getattr(i, sort_by) or datetime.datetime.now()
|
key = lambda i: getattr(i, sort_by) or datetime.datetime.now()
|
||||||
|
@ -456,8 +456,8 @@ class RegieDirectory(Directory):
|
||||||
r += htmltext('</form>')
|
r += htmltext('</form>')
|
||||||
|
|
||||||
r += htmltext('</td></tr>')
|
r += htmltext('</td></tr>')
|
||||||
transactions = Transaction.get_with_indexed_value('invoice_ids',
|
transactions = list(Transaction.get_with_indexed_value('invoice_ids',
|
||||||
invoice.id)
|
invoice.id))
|
||||||
for transaction in sorted(transactions, key=lambda x: x.start):
|
for transaction in sorted(transactions, key=lambda x: x.start):
|
||||||
r += htmltext('<tr>')
|
r += htmltext('<tr>')
|
||||||
r += htmltext('<td></td>')
|
r += htmltext('<td></td>')
|
||||||
|
|
Reference in New Issue