lib.itmens/users/forms.py

23 lines
633 B
Python
Raw Normal View History

2020-05-05 23:50:48 +08:00
from django import forms
from django.utils.translation import gettext_lazy as _
2020-07-03 15:36:23 +08:00
from common.forms import PreviewImageInput
2020-05-05 23:50:48 +08:00
from .models import Report
2023-01-11 19:11:31 -05:00
2020-05-05 23:50:48 +08:00
class ReportForm(forms.ModelForm):
class Meta:
model = Report
fields = [
2023-01-11 19:11:31 -05:00
"reported_user",
"image",
"message",
2020-05-05 23:50:48 +08:00
]
widgets = {
2023-01-11 19:11:31 -05:00
"message": forms.Textarea(attrs={"placeholder": _("详情")}),
"image": PreviewImageInput(),
"reported_user": forms.HiddenInput(),
2023-01-11 19:11:31 -05:00
}
2023-02-04 10:56:14 -05:00
labels = {"reported_user": _("投诉对象"), "image": _("相关证据"), "message": _("详情")}