Coverage for apps / profiles / models.py: 92%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-02-14 19:13 +0000

1from django.db import models 

2 

3 

4class Profile(models.Model): 

5 """User profile for the recipe app.""" 

6 

7 THEME_CHOICES = [ 

8 ("light", "Light"), 

9 ("dark", "Dark"), 

10 ] 

11 

12 UNIT_CHOICES = [ 

13 ("metric", "Metric"), 

14 ("imperial", "Imperial"), 

15 ] 

16 

17 name = models.CharField(max_length=100) 

18 avatar_color = models.CharField(max_length=7) # Hex color 

19 theme = models.CharField(max_length=10, choices=THEME_CHOICES, default="light") 

20 unit_preference = models.CharField(max_length=10, choices=UNIT_CHOICES, default="metric") 

21 created_at = models.DateTimeField(auto_now_add=True) 

22 updated_at = models.DateTimeField(auto_now=True) 

23 

24 def __str__(self): 

25 return self.name 

← Back to Dashboard