cheesy/moku/forms/recipe.py

22 lines
510 B
Python
Raw Normal View History

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):
"""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):
"""Form for creating and updating steps of a recipe."""
2024-03-25 21:46:47 +00:00
class Meta:
model = RecipeStep
fields = ("instructions",)