vafling/mercantile/models.py

29 lines
642 B
Python
Raw Normal View History

from django.db import models
2015-08-16 16:03:06 +02:00
from waffles.models import Event, UserProfile
2015-08-16 16:03:06 +02:00
# Create your models here.
class Debt(models.Model):
amount = models.BigIntegerField()
2015-08-16 16:03:06 +02:00
debtor = models.ForeignKey(UserProfile, related_name="debtor")
debtee = models.ForeignKey(UserProfile, related_name="debtee")
# oversikt over oppgjør, for logging
class Calculation(models.Model):
debt = models.ForeignKey(Debt)
event = models.ForeignKey(Event)
date = models.DateTimeField()
# Lagring av oppgjør
class Settlement(models.Model):
debt = models.ForeignKey(Debt)
dato = models.DateField()
amount = models.IntegerField()