Skip to content

Commit

Permalink
Merge pull request #2140 from FJNR-inc/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
MelanieFJNR authored Nov 6, 2023
2 parents d7f890c + c79c650 commit 4730b20
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions store/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class OrderLineResource(resources.ModelResource):
attribute='content_type__model',
)

transaction_date = fields.Field()

item_name = fields.Field()

item_id = fields.Field()
Expand All @@ -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 = (
Expand All @@ -120,6 +126,7 @@ class Meta:
'item_id',
'quantity',
'order',
'transaction_date',
'coupon',
'coupon_real_value',
'cost',
Expand All @@ -132,6 +139,7 @@ class Meta:
'item_id',
'quantity',
'order',
'transaction_date',
'coupon',
'coupon_real_value',
'cost',
Expand Down

0 comments on commit 4730b20

Please sign in to comment.