lib.itmens/users/forms.py

21 lines
633 B
Python
Raw Normal View History

2020-05-05 23:50:48 +08:00
from django import forms
from .models import Report
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
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()
2020-07-03 15:36:23 +08:00
# 'reported_user': forms.TextInput(),
2023-01-11 19:11:31 -05:00
}
labels = {"reported_user": _("举报的用户"), "image": _("相关证据"), "message": _("详情")}