From 83bc616db700406c8254ae036ef5f41796e80a79 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sun, 6 Jun 2021 14:34:24 +0300 Subject: Python 3 fixes --- servo/views/product.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'servo/views') diff --git a/servo/views/product.py b/servo/views/product.py index d2c6750..e95dbc3 100644 --- a/servo/views/product.py +++ b/servo/views/product.py @@ -159,7 +159,7 @@ def get_inventory_report(request): inventory, codemap = {}, {} for k in cursor.fetchall(): - product_id = unicode(k[0]) + product_id = str(k[0]) codemap[product_id] = k[1] # map product IDs to product codes inv_slot = {k[2]: k[3]} @@ -175,7 +175,7 @@ def get_inventory_report(request): amount = p.get(i, '0') # fill empty inventory slots with zeros inventory_cols.append(amount) - code = unicode(codemap[k]) + code = str(codemap[k]) row = [k, code] + inventory_cols response.write("\t".join(row) + "\n") @@ -200,9 +200,9 @@ def download_products(request, group="all"): # @FIXME: Add total stocked amount to product # currently the last column is a placeholder for stock counts in inventory uploads for p in products: - row = [unicode(i) for i in (p.pk, p.code, p.title, - p.price_purchase_stock, - p.price_sales_stock, 0)] + row = [str(i) for i in (p.pk, p.code, p.title, + p.price_purchase_stock, + p.price_sales_stock, 0)] data += "\t".join(row) + "\n" return send_csv(data, filename) -- cgit v1.2.3