Add time and use to recipehop model.
This commit is contained in:
parent
06dfd5a9e9
commit
1eab86e5ae
@ -1,6 +1,7 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django_cryptography.fields import encrypt
|
from django_cryptography.fields import encrypt
|
||||||
|
from django.core.validators import MinValueValidator
|
||||||
|
|
||||||
from config.extras import BREWFATHER_APP_ROOT
|
from config.extras import BREWFATHER_APP_ROOT
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@ -140,9 +141,18 @@ class Hop(CustomIngredient):
|
|||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
class RecipeHop(CustomModel):
|
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)
|
recipe = models.ForeignKey(BatchRecipe, on_delete=models.CASCADE)
|
||||||
hop = models.ForeignKey(Hop, on_delete=models.CASCADE)
|
hop = models.ForeignKey(Hop, on_delete=models.CASCADE)
|
||||||
quantity = models.DecimalField(max_digits=6, decimal_places=4)
|
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):
|
class Misc(CustomIngredient):
|
||||||
uses = {
|
uses = {
|
||||||
|
Loading…
Reference in New Issue
Block a user