cheesy/moku/forms/recipe.py
2025-11-23 10:57:34 +00:00

25 lines
557 B
Python
Executable file

from django.forms import Form, ModelForm
from django.utils.translation import gettext_lazy as _
from moku.models.recipe import Recipe, RecipeStep
class DeleteRecipeForm(Form):
pass
class RecipeForm(ModelForm):
"""Form for creating and updating recipes."""
class Meta:
model = Recipe
fields = ("title",)
labels = {"title": _("recipe title")}
class RecipeStepForm(ModelForm):
"""Form for creating and updating steps of a recipe."""
class Meta:
model = RecipeStep
fields = ("instructions",)