1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-30 04:13:01 +00:00

[note] Added type property to transactions

This commit is contained in:
Benjamin Graillot 2020-03-14 13:16:18 +01:00 committed by Bombar Maxime
parent 5d15b8c613
commit 49952355e6

View File

@ -157,6 +157,10 @@ class Transaction(PolymorphicModel):
def total(self): def total(self):
return self.amount * self.quantity return self.amount * self.quantity
@property
def type(self):
return _('transfert')
class TemplateTransaction(Transaction): class TemplateTransaction(Transaction):
""" """
@ -174,6 +178,10 @@ class TemplateTransaction(Transaction):
on_delete=models.PROTECT, on_delete=models.PROTECT,
) )
@property
def type(self):
return _('template')
class MembershipTransaction(Transaction): class MembershipTransaction(Transaction):
""" """
@ -190,3 +198,7 @@ class MembershipTransaction(Transaction):
class Meta: class Meta:
verbose_name = _("membership transaction") verbose_name = _("membership transaction")
verbose_name_plural = _("membership transactions") verbose_name_plural = _("membership transactions")
@property
def type(self):
return _('membership')