Skip to content

Commit

Permalink
Add FK to shipping event from payment event
Browse files Browse the repository at this point in the history
This allows them to be linked together which is often how the occur in
the real world.
  • Loading branch information
codeinthehole committed Jul 2, 2013
1 parent 11242f2 commit 8bcd72d
Show file tree
Hide file tree
Showing 2 changed files with 388 additions and 1 deletion.
8 changes: 7 additions & 1 deletion oscar/apps/order/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,13 @@ class AbstractPaymentEvent(models.Model):
verbose_name=_("Lines"))
event_type = models.ForeignKey(
'order.PaymentEventType', verbose_name=_("Event Type"))
date_created = models.DateTimeField(_("Date Created"), auto_now_add=True)
# Allow payment events to be linked to shipping events. Often a shipping
# event will trigger a payment event and so we can use this FK to capture
# the relationship.
shipping_event = models.ForeignKey(
'order.ShippingEvent', related_name='payment_events',
null=True)
date_created = models.DateTimeField(_("Date created"), auto_now_add=True)

class Meta:
abstract = True
Expand Down

0 comments on commit 8bcd72d

Please sign in to comment.