Commits

Ian George  committed d831018

Changes to add SKU to orderItem __unicode__

  • Participants
  • Parent commits 5dfa8ab

Comments (0)

Files changed (2)

File quiet/shop/admin.py

 class OrderItemInline(admin.TabularInline):
     model=OrderItem
     extra=0
-    exclude = ('product_content_type', 'product_object_id', 'tax')
+    exclude = ('product_content_type', 'product_object_id', 'tax',)
 
 class OrderStatusInline(admin.TabularInline):
     model=OrderStatus

File quiet/shop/models/order.py

         app_label='shop'
 
     def __unicode__(self):
-        return str(self.product)
+        if hasattr(self.product, 'SKU'):
+            return "%s - %s" % (self.product.SKU, self.product)
+        else:
+            return "%s" % (self.product,)
 
 class OrderAddress(models.Model):
     order = models.ForeignKey(Order, related_name='addresses')