added gitea activity for fun
This commit is contained in:
@@ -5,6 +5,7 @@ from django.core.exceptions import ValidationError
|
||||
from django.core.validators import MaxValueValidator, MinValueValidator
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
class Task(models.Model):
|
||||
@@ -116,6 +117,12 @@ class UserSettings(models.Model):
|
||||
)
|
||||
onboarding_enabled = models.BooleanField(default=True)
|
||||
onboarding_step = models.PositiveSmallIntegerField(default=0)
|
||||
daily_water_goal_ml = models.PositiveIntegerField(
|
||||
default=2000, validators=[MinValueValidator(250), MaxValueValidator(10000)],
|
||||
)
|
||||
ntfy_url = models.URLField(blank=True)
|
||||
ntfy_enabled = models.BooleanField(default=False)
|
||||
ntfy_last_tested_at = models.DateTimeField(null=True, blank=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
@@ -341,6 +348,7 @@ class FastingSettings(models.Model):
|
||||
validators=[MinValueValidator(1), MaxValueValidator((24 * 60) - 1)],
|
||||
)
|
||||
tracking_started_at = models.DateTimeField(blank=True, null=True)
|
||||
last_phase_notification_at = models.DateTimeField(blank=True, null=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
@@ -366,6 +374,16 @@ class FastingPause(models.Model):
|
||||
return f'Fasting pause for {self.user} at {self.paused_at}'
|
||||
|
||||
|
||||
class WaterIntakeEntry(models.Model):
|
||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='water_entries')
|
||||
amount_ml = models.PositiveIntegerField(validators=[MinValueValidator(1), MaxValueValidator(3000)])
|
||||
recorded_at = models.DateTimeField(default=timezone.now, db_index=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ('-recorded_at', '-pk')
|
||||
|
||||
|
||||
class FastingPeriod(models.Model):
|
||||
class Status(models.TextChoices):
|
||||
COMPLETED = 'completed', 'Completed'
|
||||
|
||||
Reference in New Issue
Block a user