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