diff options
Diffstat (limited to 'postgresqleu/transferwise/models.py')
| -rw-r--r-- | postgresqleu/transferwise/models.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/postgresqleu/transferwise/models.py b/postgresqleu/transferwise/models.py index fbca49ad..0659149b 100644 --- a/postgresqleu/transferwise/models.py +++ b/postgresqleu/transferwise/models.py @@ -4,7 +4,7 @@ from postgresqleu.invoices.models import InvoicePaymentMethod class TransferwiseTransaction(models.Model): - paymentmethod = models.ForeignKey(InvoicePaymentMethod, blank=False, null=False) + paymentmethod = models.ForeignKey(InvoicePaymentMethod, blank=False, null=False, on_delete=models.CASCADE) twreference = models.CharField(max_length=100, blank=False, null=False) datetime = models.DateTimeField(null=False, blank=False) amount = models.DecimalField(decimal_places=2, max_digits=20, null=False) @@ -27,8 +27,8 @@ class TransferwiseTransaction(models.Model): class TransferwiseRefund(models.Model): - origtransaction = models.ForeignKey(TransferwiseTransaction, blank=False, null=False, related_name='refund_orig') - refundtransaction = models.OneToOneField(TransferwiseTransaction, blank=True, null=True, related_name='refund_refund', unique=True) + origtransaction = models.ForeignKey(TransferwiseTransaction, blank=False, null=False, related_name='refund_orig', on_delete=models.CASCADE) + refundtransaction = models.OneToOneField(TransferwiseTransaction, blank=True, null=True, related_name='refund_refund', unique=True, on_delete=models.CASCADE) refundid = models.BigIntegerField(null=False, unique=True) uuid = models.UUIDField(blank=False, null=False, unique=True) transferid = models.BigIntegerField(null=False, unique=True) @@ -39,7 +39,7 @@ class TransferwiseRefund(models.Model): class TransferwisePayout(models.Model): - paymentmethod = models.ForeignKey(InvoicePaymentMethod, blank=False, null=False) + paymentmethod = models.ForeignKey(InvoicePaymentMethod, blank=False, null=False, on_delete=models.CASCADE) amount = models.DecimalField(decimal_places=2, max_digits=20, null=False) reference = models.CharField(max_length=100, null=False, blank=False, unique=True) counterpart_name = models.CharField(max_length=100, blank=True, null=False) @@ -51,11 +51,11 @@ class TransferwisePayout(models.Model): createdat = models.DateTimeField(null=False, blank=False, auto_now_add=True) sentat = models.DateTimeField(null=True, blank=True) completedat = models.DateTimeField(null=True, blank=True) - completedtrans = models.ForeignKey(TransferwiseTransaction, blank=True, null=True) + completedtrans = models.ForeignKey(TransferwiseTransaction, blank=True, null=True, on_delete=models.CASCADE) class TransferwiseMonthlyStatement(models.Model): - paymentmethod = models.ForeignKey(InvoicePaymentMethod, blank=False, null=False) + paymentmethod = models.ForeignKey(InvoicePaymentMethod, blank=False, null=False, on_delete=models.CASCADE) month = models.DateField(null=False, blank=False) downloaded = models.DateTimeField(null=False, blank=False, auto_now_add=True) contents = models.BinaryField(null=False) |
