lib.itmens/users/forms.py

23 lines
679 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
class ReportForm(forms.ModelForm):
class Meta:
model = Report
fields = [
'reported_user',
'image',
'message',
]
widgets = {
'message': forms.Textarea(attrs={'placeholder': _("详情")}),
2020-07-03 15:36:23 +08:00
'image': PreviewImageInput()
# 'reported_user': forms.TextInput(),
2020-05-07 18:00:39 +08:00
}
labels = {
'reported_user': _("举报的用户"),
'image': _("相关证据"),
'message': _("详情")
}