diff --git a/beer/models.py b/beer/models.py index efe4aa5..d97a5a6 100644 --- a/beer/models.py +++ b/beer/models.py @@ -1,6 +1,7 @@ from django.db import models from django.utils import timezone from django_cryptography.fields import encrypt +from django.core.validators import MinValueValidator from config.extras import BREWFATHER_APP_ROOT from django.conf import settings @@ -140,9 +141,18 @@ class Hop(CustomIngredient): return self.name class RecipeHop(CustomModel): + uses = { + 1: 'Boil', + 2: 'Dry Hop', + 3: 'Aroma (Hop Stand)', + 4: 'Mash', + 5: 'First Wort' + } recipe = models.ForeignKey(BatchRecipe, on_delete=models.CASCADE) hop = models.ForeignKey(Hop, on_delete=models.CASCADE) quantity = models.DecimalField(max_digits=6, decimal_places=4) + time = models.IntegerField(default=60, validators=[MinValueValidator(0)]) + use = models.IntegerField(choices=uses, default=1) class Misc(CustomIngredient): uses = {