aboutsummaryrefslogtreecommitdiffstats
path: root/servo/views
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-06-06 14:34:24 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-06-06 14:34:24 +0300
commit83bc616db700406c8254ae036ef5f41796e80a79 (patch)
tree146a8e8bcf1bfab7d771c3a26468190307e1e95b /servo/views
parentbc273f17cd8e08c6944660b8633ba41763f292b2 (diff)
downloadServo-83bc616db700406c8254ae036ef5f41796e80a79.tar.gz
Servo-83bc616db700406c8254ae036ef5f41796e80a79.tar.bz2
Servo-83bc616db700406c8254ae036ef5f41796e80a79.zip
Python 3 fixes
Diffstat (limited to 'servo/views')
-rw-r--r--servo/views/product.py10
1 files changed, 5 insertions, 5 deletions
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)