1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 18:08:21 +02:00

Add/ Complete docstring for every models.

This commit is contained in:
Pierre-antoine Comby
2020-01-21 22:06:06 +01:00
parent 7764abc0c0
commit 5a7d779a90
4 changed files with 56 additions and 12 deletions

View File

@ -15,6 +15,11 @@ Defines transactions
class TransactionTemplate(models.Model):
"""
Defined a reccurent transaction
associated to selling something (a burger, a beer, ...)
"""
name = models.CharField(
verbose_name=_('name'),
max_length=255,
@ -44,6 +49,15 @@ class TransactionTemplate(models.Model):
class Transaction(models.Model):
"""
General transaction between two :model:`note.Note`
amount is store in centimes of currency, making it a positive integer
value. (from someone to someone else)
TODO: Ensure source != destination.
"""
source = models.ForeignKey(
Note,
on_delete=models.PROTECT,
@ -112,6 +126,11 @@ class Transaction(models.Model):
class MembershipTransaction(Transaction):
"""
Special type of :model:`note.Transaction` associated to a :model:`member.Membership`.
"""
membership = models.OneToOneField(
'member.Membership',
on_delete=models.PROTECT,