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

12 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-11 00:40 +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( 

21 max_length=10, choices=UNIT_CHOICES, default='metric' 

22 ) 

23 created_at = models.DateTimeField(auto_now_add=True) 

24 updated_at = models.DateTimeField(auto_now=True) 

25 

26 def __str__(self): 

27 return self.name 

← Back to Dashboard