2018-08-08 18:07:59 +00:00
|
|
|
from django.db import models
|
|
|
|
from django.conf import settings
|
|
|
|
from django.contrib.auth.models import User
|
2019-07-27 11:58:09 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2018-08-08 18:07:59 +00:00
|
|
|
|
2019-07-26 21:32:50 +00:00
|
|
|
class Target(models.Model):
|
2019-07-27 11:58:09 +00:00
|
|
|
target = models.PositiveIntegerField(_('Target to reach'))
|
2019-07-26 21:32:50 +00:00
|
|
|
user = models.ForeignKey(
|
|
|
|
settings.AUTH_USER_MODEL,
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
primary_key = True
|
|
|
|
)
|
|
|
|
|
2018-08-08 18:07:59 +00:00
|
|
|
class ArrowCount(models.Model):
|
|
|
|
user = models.ForeignKey(
|
|
|
|
settings.AUTH_USER_MODEL,
|
|
|
|
on_delete=models.CASCADE
|
|
|
|
)
|
2019-07-27 11:58:09 +00:00
|
|
|
date = models.DateField(_('Training date'))
|
|
|
|
count = models.PositiveIntegerField(_('Arrow count for the day'))
|
2018-08-08 18:07:59 +00:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.date.strftime("%x") + ": " + str(self.count)
|