cheesy/moku/forms/post.py

20 lines
489 B
Python
Raw Normal View History

2024-03-25 10:36:10 +00:00
from django.forms import ModelForm
from django.utils.translation import gettext_lazy as _
from moku.models import Post
class PostForm(ModelForm):
"""Form for creating and updating posts."""
2024-03-25 10:36:10 +00:00
class Meta:
model = Post
2024-03-25 21:46:47 +00:00
fields = ("emoji", "verb", "food", "recipe", "image")
2024-03-25 10:36:10 +00:00
labels = {
"emoji": _("emoji"),
"verb": _("verb"),
"food": _("food"),
2024-03-25 21:46:47 +00:00
"recipe": _("recipe"),
2024-03-25 10:36:10 +00:00
"image": _("image"),
}