mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Fix formatting issues
This commit is contained in:
@ -7,12 +7,13 @@ from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.urls import reverse
|
||||
|
||||
from .notes import Note,NoteClub
|
||||
from .notes import Note, NoteClub
|
||||
|
||||
"""
|
||||
Defines transactions
|
||||
"""
|
||||
|
||||
|
||||
class TransactionCategory(models.Model):
|
||||
"""
|
||||
Defined a recurrent transaction category
|
||||
@ -32,6 +33,7 @@ class TransactionCategory(models.Model):
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
class TransactionTemplate(models.Model):
|
||||
"""
|
||||
Defined a recurrent transaction
|
||||
@ -57,7 +59,7 @@ class TransactionTemplate(models.Model):
|
||||
TransactionCategory,
|
||||
on_delete=models.PROTECT,
|
||||
verbose_name=_('type'),
|
||||
max_length=31
|
||||
max_length=31,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
@ -65,7 +67,7 @@ class TransactionTemplate(models.Model):
|
||||
verbose_name_plural = _("transaction templates")
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('note:template_update',args=(self.pk,))
|
||||
return reverse('note:template_update', args=(self.pk, ))
|
||||
|
||||
|
||||
class Transaction(models.Model):
|
||||
@ -98,9 +100,7 @@ class Transaction(models.Model):
|
||||
verbose_name=_('quantity'),
|
||||
default=1,
|
||||
)
|
||||
amount = models.PositiveIntegerField(
|
||||
verbose_name=_('amount'),
|
||||
)
|
||||
amount = models.PositiveIntegerField(verbose_name=_('amount'), )
|
||||
transaction_type = models.CharField(
|
||||
verbose_name=_('type'),
|
||||
max_length=31,
|
||||
@ -142,7 +142,7 @@ class Transaction(models.Model):
|
||||
|
||||
@property
|
||||
def total(self):
|
||||
return self.amount*self.quantity
|
||||
return self.amount * self.quantity
|
||||
|
||||
|
||||
class MembershipTransaction(Transaction):
|
||||
|
Reference in New Issue
Block a user