generated from 2martens/django-template
Added calories to profile and converted nutritional data to decimal fields
This commit is contained in:
@ -17,24 +17,42 @@ MEASUREMENT_UNITS = [('KG', 'kg'),
|
||||
|
||||
class Profile(models.Model):
|
||||
user = models.OneToOneField(User, models.CASCADE)
|
||||
daily_fat_demand = models.PositiveIntegerField(_('Daily fat demand'),
|
||||
help_text=_('At most this amount of fat is needed per day'),
|
||||
default=117)
|
||||
daily_carbohydrate_demand = models.PositiveIntegerField(
|
||||
daily_calories_demand = models.DecimalField(_('Daily kilo calories demand'),
|
||||
help_text=_('At most this amount of kilo calories is needed per day'),
|
||||
default=2000.00,
|
||||
decimal_places=2,
|
||||
max_digits=6)
|
||||
daily_fat_demand = models.DecimalField(_('Daily fat demand'),
|
||||
help_text=_('At most this amount of fat is needed per day'),
|
||||
default=117.00,
|
||||
decimal_places=2,
|
||||
max_digits=5)
|
||||
daily_carbohydrate_demand = models.DecimalField(
|
||||
_('Daily carbohydrate demand'),
|
||||
help_text=_('At most this amount of carbohydrates is needed per day'),
|
||||
default=150)
|
||||
daily_sugar_demand = models.PositiveIntegerField(_('Daily sugar demand'),
|
||||
help_text=_('At most this amount of sugar is needed per day'),
|
||||
default=25)
|
||||
daily_roughage_demand = models.PositiveIntegerField(
|
||||
default=150.00,
|
||||
decimal_places=2,
|
||||
max_digits=5,
|
||||
)
|
||||
daily_sugar_demand = models.DecimalField(_('Daily sugar demand'),
|
||||
help_text=_('At most this amount of sugar is needed per day'),
|
||||
default=25.00,
|
||||
decimal_places=2,
|
||||
max_digits=5)
|
||||
daily_roughage_demand = models.DecimalField(
|
||||
_('Daily roughage demand'),
|
||||
help_text=_('At least this amount of roughage should be eaten per day'),
|
||||
default=30)
|
||||
daily_protein_demand = models.PositiveIntegerField(
|
||||
default=30.00,
|
||||
decimal_places=2,
|
||||
max_digits=5
|
||||
)
|
||||
daily_protein_demand = models.DecimalField(
|
||||
_('Daily protein demand'),
|
||||
help_text=_('At most this amount of protein should be eaten per day'),
|
||||
default=90)
|
||||
default=90.00,
|
||||
decimal_places=2,
|
||||
max_digits=5,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Profile')
|
||||
@ -82,18 +100,18 @@ class Recipe(models.Model):
|
||||
('EXP', _('Expert'))
|
||||
])
|
||||
|
||||
calories = models.PositiveIntegerField(_('Calories'),
|
||||
help_text=_('How many calories are contained in one portion?'))
|
||||
fat = models.PositiveIntegerField(_('Fat'),
|
||||
help_text=_('How much fat does one portion contain?'))
|
||||
carbohydrates = models.PositiveIntegerField(_('Carbohydrates'),
|
||||
help_text=_('How much carbohydrates does one portion contain?'))
|
||||
sugar = models.PositiveIntegerField(_('Sugar'),
|
||||
help_text=_('How much sugar does one portion contain?'))
|
||||
roughage = models.PositiveIntegerField(_('Roughage'),
|
||||
help_text=_('How much roughage does one portion contain?'))
|
||||
protein = models.PositiveIntegerField(_('Protein'),
|
||||
help_text=_('How much protein does one portion contain?'))
|
||||
calories = models.DecimalField(_('Kilo Calories'), decimal_places=2, max_digits=6,
|
||||
help_text=_('How many kilo calories are contained in one portion?'))
|
||||
fat = models.DecimalField(_('Fat'), decimal_places=2, max_digits=5,
|
||||
help_text=_('How much fat does one portion contain?'))
|
||||
carbohydrates = models.DecimalField(_('Carbohydrates'), decimal_places=2, max_digits=5,
|
||||
help_text=_('How much carbohydrates does one portion contain?'))
|
||||
sugar = models.DecimalField(_('Sugar'), decimal_places=2, max_digits=5,
|
||||
help_text=_('How much sugar does one portion contain?'))
|
||||
roughage = models.DecimalField(_('Roughage'), decimal_places=2, max_digits=5,
|
||||
help_text=_('How much roughage does one portion contain?'))
|
||||
protein = models.DecimalField(_('Protein'), decimal_places=2, max_digits=5,
|
||||
help_text=_('How much protein does one portion contain?'))
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Recipe')
|
||||
|
||||
Reference in New Issue
Block a user