arrowcounter/counter/models.py
2019-07-27 00:01:25 +02:00

22 lines
663 B
Python

from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
class Target(models.Model):
target = models.PositiveIntegerField('Target to reach')
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
primary_key = True
)
class ArrowCount(models.Model):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE
)
date = models.DateField('Training date')
count = models.PositiveIntegerField('Arrow count for the day')
def __str__(self):
return self.date.strftime("%x") + ": " + str(self.count)