Add time and use to recipehop model.

This commit is contained in:
Chris Giacofei 2024-06-17 14:25:09 -04:00
parent 06dfd5a9e9
commit 1eab86e5ae

View File

@ -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 = {