diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-29 01:20:06 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-01-09 15:34:19 +0100 |
commit | af104fce9bc3b95c44371a1b137d1a733de027b2 (patch) | |
tree | 6ba8f1373115348b6485f46e583512bef2ee9281 /talerbank/app/models.py | |
parent | f325bdb8ca56574b0524fbe5d3f29c2a56832123 (diff) | |
download | bank-af104fce9bc3b95c44371a1b137d1a733de027b2.tar.gz bank-af104fce9bc3b95c44371a1b137d1a733de027b2.tar.bz2 bank-af104fce9bc3b95c44371a1b137d1a733de027b2.zip |
The big refactor.
Diffstat (limited to 'talerbank/app/models.py')
-rw-r--r-- | talerbank/app/models.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/talerbank/app/models.py b/talerbank/app/models.py index 2c4d44d..1b84fe9 100644 --- a/talerbank/app/models.py +++ b/talerbank/app/models.py @@ -13,6 +13,7 @@ # TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> # # @author Marcello Stanisci +# @author Florian Dold from __future__ import unicode_literals from django.contrib.auth.models import User @@ -27,14 +28,10 @@ class BankAccount(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) -class History(models.Model): +class BankTransaction(models.Model): amount = models.FloatField(default=0) currency = models.CharField(max_length=12) - direction = models.CharField(max_length=4) - counterpart = models.ForeignKey(BankAccount, - on_delete=models.CASCADE, - related_name="counterpart_account") - subject = models.CharField(default="not given", max_length=200) + debit_account = models.ForeignKey(BankAccount, on_delete=models.CASCADE, related_name="debit_account") + credit_account = models.ForeignKey(BankAccount, on_delete=models.CASCADE, related_name="credit_account") + subject = models.CharField(default="(no subject given)", max_length=200) date = models.DateTimeField(auto_now=True) - account = models.ForeignKey(BankAccount, on_delete=models.CASCADE) - # NOTE: by default, UTC timezone is used. |