Model strings
This commit is contained in:
parent
76b9f78b46
commit
ad154b6954
3 changed files with 12 additions and 3 deletions
|
@ -6,3 +6,6 @@ class Card(models.Model):
|
||||||
number = models.IntegerField("Card number", primary_key=True)
|
number = models.IntegerField("Card number", primary_key=True)
|
||||||
purchased = models.DateTimeField("Card purchased", auto_now_add=True)
|
purchased = models.DateTimeField("Card purchased", auto_now_add=True)
|
||||||
delivered = models.DateTimeField("Card delivered to Oma", default=None, null=True)
|
delivered = models.DateTimeField("Card delivered to Oma", default=None, null=True)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.number)
|
|
@ -5,3 +5,6 @@ from django.db import models
|
||||||
class Setting(models.Model):
|
class Setting(models.Model):
|
||||||
key = models.CharField(primary_key=True, max_length=512)
|
key = models.CharField(primary_key=True, max_length=512)
|
||||||
value = models.CharField(max_length=512)
|
value = models.CharField(max_length=512)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.key
|
|
@ -7,3 +7,6 @@ class Payment(models.Model):
|
||||||
amount = models.DecimalField("Payment amount", max_digits=15, decimal_places=2)
|
amount = models.DecimalField("Payment amount", max_digits=15, decimal_places=2)
|
||||||
date = models.DateTimeField("Date of payment", auto_now_add=True)
|
date = models.DateTimeField("Date of payment", auto_now_add=True)
|
||||||
repayment = models.DateTimeField("Date of repayment", default=None, null=True)
|
repayment = models.DateTimeField("Date of repayment", default=None, null=True)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.description
|
Loading…
Reference in a new issue