From ad154b69544ac48b37a4d466b96022bbb3638954 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 26 Oct 2019 17:39:14 +0200 Subject: [PATCH] Model strings --- buyer/models.py | 5 ++++- dbsettings/models.py | 5 ++++- ledger/models.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/buyer/models.py b/buyer/models.py index 90ee8ca..fdfe2db 100644 --- a/buyer/models.py +++ b/buyer/models.py @@ -5,4 +5,7 @@ from django.db import models class Card(models.Model): number = models.IntegerField("Card number", primary_key=True) purchased = models.DateTimeField("Card purchased", auto_now_add=True) - delivered = models.DateTimeField("Card delivered to Oma", default=None, null=True) \ No newline at end of file + delivered = models.DateTimeField("Card delivered to Oma", default=None, null=True) + + def __str__(self): + return str(self.number) \ No newline at end of file diff --git a/dbsettings/models.py b/dbsettings/models.py index c26c0ce..7fa8887 100644 --- a/dbsettings/models.py +++ b/dbsettings/models.py @@ -4,4 +4,7 @@ from django.db import models class Setting(models.Model): key = models.CharField(primary_key=True, max_length=512) - value = models.CharField(max_length=512) \ No newline at end of file + value = models.CharField(max_length=512) + + def __str__(self): + return self.key \ No newline at end of file diff --git a/ledger/models.py b/ledger/models.py index 1682efa..bfdde50 100644 --- a/ledger/models.py +++ b/ledger/models.py @@ -6,4 +6,7 @@ class Payment(models.Model): description = models.CharField("Payment description", max_length=128) amount = models.DecimalField("Payment amount", max_digits=15, decimal_places=2) date = models.DateTimeField("Date of payment", auto_now_add=True) - repayment = models.DateTimeField("Date of repayment", default=None, null=True) \ No newline at end of file + repayment = models.DateTimeField("Date of repayment", default=None, null=True) + + def __str__(self): + return self.description \ No newline at end of file