mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Consos
This commit is contained in:
@ -4,11 +4,11 @@
|
||||
|
||||
from .notes import Alias, Note, NoteClub, NoteSpecial, NoteUser
|
||||
from .transactions import MembershipTransaction, Transaction, \
|
||||
TransactionTemplate
|
||||
TransactionCategory, TransactionTemplate
|
||||
|
||||
__all__ = [
|
||||
# Notes
|
||||
'Alias', 'Note', 'NoteClub', 'NoteSpecial', 'NoteUser',
|
||||
# Transactions
|
||||
'MembershipTransaction', 'Transaction', 'TransactionTemplate',
|
||||
'MembershipTransaction', 'Transaction', 'TransactionCategory', 'TransactionTemplate',
|
||||
]
|
||||
|
@ -13,10 +13,28 @@ from .notes import Note,NoteClub
|
||||
Defines transactions
|
||||
"""
|
||||
|
||||
class TransactionCategory(models.Model):
|
||||
"""
|
||||
Defined a recurrent transaction category
|
||||
|
||||
Example: food, softs, ...
|
||||
"""
|
||||
name = models.CharField(
|
||||
verbose_name=_("name"),
|
||||
max_length=31,
|
||||
unique=True,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("transaction category")
|
||||
verbose_name_plural = _("transaction categories")
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
class TransactionTemplate(models.Model):
|
||||
"""
|
||||
Defined a reccurent transaction
|
||||
Defined a recurrent transaction
|
||||
|
||||
associated to selling something (a burger, a beer, ...)
|
||||
"""
|
||||
@ -35,7 +53,9 @@ class TransactionTemplate(models.Model):
|
||||
verbose_name=_('amount'),
|
||||
help_text=_('in centimes'),
|
||||
)
|
||||
template_type = models.CharField(
|
||||
template_type = models.ForeignKey(
|
||||
TransactionCategory,
|
||||
on_delete=models.PROTECT,
|
||||
verbose_name=_('type'),
|
||||
max_length=31
|
||||
)
|
||||
|
Reference in New Issue
Block a user