Add str to Transfer model
+ PEP8 this model
This commit is contained in:
parent
78aa5df350
commit
f6022ecf7d
|
@ -476,6 +476,7 @@ class TransferGroup(models.Model):
|
||||||
related_name = "+",
|
related_name = "+",
|
||||||
blank = True, null = True, default = None)
|
blank = True, null = True, default = None)
|
||||||
|
|
||||||
|
|
||||||
class Transfer(models.Model):
|
class Transfer(models.Model):
|
||||||
group = models.ForeignKey(
|
group = models.ForeignKey(
|
||||||
TransferGroup, on_delete=models.PROTECT,
|
TransferGroup, on_delete=models.PROTECT,
|
||||||
|
@ -495,6 +496,10 @@ class Transfer(models.Model):
|
||||||
canceled_at = models.DateTimeField(
|
canceled_at = models.DateTimeField(
|
||||||
null=True, blank=True, default=None)
|
null=True, blank=True, default=None)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return '{} -> {}: {}€'.format(self.from_acc, self.to_acc, self.amount)
|
||||||
|
|
||||||
|
|
||||||
class OperationGroup(models.Model):
|
class OperationGroup(models.Model):
|
||||||
on_acc = models.ForeignKey(
|
on_acc = models.ForeignKey(
|
||||||
Account, on_delete = models.PROTECT,
|
Account, on_delete = models.PROTECT,
|
||||||
|
|
Loading…
Reference in a new issue