Add many to many field with through relationship for fermentables.
Gives direct access to fermentable objects.
This commit is contained in:
parent
b6be827d14
commit
671ea27d9f
18
beer/migrations/0012_recipe_fermentables.py
Normal file
18
beer/migrations/0012_recipe_fermentables.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 5.0.6 on 2024-06-21 13:59
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('beer', '0011_rename_batchrecipe_recipe'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='recipe',
|
||||||
|
name='fermentables',
|
||||||
|
field=models.ManyToManyField(through='beer.RecipeFermentable', to='beer.fermentable'),
|
||||||
|
),
|
||||||
|
]
|
@ -106,6 +106,8 @@ class Recipe(CustomModel):
|
|||||||
max_digits=6, decimal_places=2, default=75)
|
max_digits=6, decimal_places=2, default=75)
|
||||||
batch_size = models.DecimalField(
|
batch_size = models.DecimalField(
|
||||||
max_digits=6, decimal_places=2, default=11)
|
max_digits=6, decimal_places=2, default=11)
|
||||||
|
fermentables = models.ManyToManyField(
|
||||||
|
'Fermentable', through='RecipeFermentable')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = 'Recipe'
|
verbose_name = 'Recipe'
|
||||||
|
Loading…
Reference in New Issue
Block a user