diff --git a/cashonly/admin.py b/cashonly/admin.py index 58641e7..d63c961 100644 --- a/cashonly/admin.py +++ b/cashonly/admin.py @@ -114,7 +114,7 @@ class SalesLogEntryAdmin(admin.ModelAdmin): list_display = ('account', 'timestamp', 'product', 'count', 'unit_price') list_filter = ['account', 'timestamp', 'product'] # Make sales log entries completely read-only - readonly_fields = map(lambda f: f.name, SalesLogEntry._meta.fields) + readonly_fields = list(map(lambda f: f.name, SalesLogEntry._meta.fields)) class TransactionAdmin(admin.ModelAdmin): diff --git a/cashonly/models.py b/cashonly/models.py index 9075539..7301fbe 100644 --- a/cashonly/models.py +++ b/cashonly/models.py @@ -9,7 +9,7 @@ from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_noop from django.db import transaction import PIL.Image -import StringIO +import io class Account(models.Model): @@ -138,9 +138,10 @@ class Product(models.Model): @receiver(pre_save, sender=Product) def product_post_save_handler(sender, instance, **kwargs): + # FIXME img = instance.image if img: - scaledFile = StringIO.StringIO() + scaledFile = io.StringIO() img.open(mode='r') with img: scaled = PIL.Image.open(img)