You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
691 B

from django.db import models
from django.contrib.auth.models import User
class TransactionType(models.Model):
name = models.CharField(max_length=100)
needsCheck = models.BooleanField(default=True)
def __unicode__(self):
return + (self.needsCheck and " (needs Check)" or "")
class Transaction(models.Model):
user = models.ForeignKey(User, unique=True)
transactionType = models.ForeignKey(TransactionType)
dateTime = models.DateTimeField()
amount = models.FloatField()
checked = models.BooleanField(default=False)
def __unicode__(self):
return "%s for user %s (%s), %schecked" % (self.amount, self.user, self.transactionType, (self.checked and "" or "not "))