2024-03-26 12:18:47 +00:00
|
|
|
from django.forms import ModelForm
|
2024-03-25 21:46:47 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
|
|
|
|
from moku.models.recipe import Recipe, RecipeStep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RecipeForm(ModelForm):
|
2024-03-26 12:44:19 +00:00
|
|
|
"""Form for creating and updating recipes."""
|
|
|
|
|
|
2024-03-25 21:46:47 +00:00
|
|
|
class Meta:
|
|
|
|
|
model = Recipe
|
|
|
|
|
fields = ("title",)
|
2024-03-26 12:18:47 +00:00
|
|
|
labels = {"title": _("recipe title")}
|
2024-03-25 21:46:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class RecipeStepForm(ModelForm):
|
2024-03-26 12:44:19 +00:00
|
|
|
"""Form for creating and updating steps of a recipe."""
|
|
|
|
|
|
2024-03-25 21:46:47 +00:00
|
|
|
class Meta:
|
|
|
|
|
model = RecipeStep
|
|
|
|
|
fields = ("instructions",)
|