diff --git a/store/resources.py b/store/resources.py index 30d7dbc0..ceea0f42 100644 --- a/store/resources.py +++ b/store/resources.py @@ -94,6 +94,8 @@ class OrderLineResource(resources.ModelResource): attribute='content_type__model', ) + transaction_date = fields.Field() + item_name = fields.Field() item_id = fields.Field() @@ -110,6 +112,10 @@ def dehydrate_item_id(self, orderline): model = get_model_from_name(orderline.content_type.model) return model.objects.get(id=orderline.object_id).id + def dehydrate_transaction_date(self, orderline): + date = orderline.order.transaction_date + return date.strftime('%Y-%m-%d %H:%M:%S') + class Meta: model = OrderLine fields = ( @@ -120,6 +126,7 @@ class Meta: 'item_id', 'quantity', 'order', + 'transaction_date', 'coupon', 'coupon_real_value', 'cost', @@ -132,6 +139,7 @@ class Meta: 'item_id', 'quantity', 'order', + 'transaction_date', 'coupon', 'coupon_real_value', 'cost',