/
oriono
/
taskman
Обзор
Документация
Войти
/
oriono
/
taskman
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
task_manager/forms.py
28 строк
860 B
abo
Add MaxLengthValidator to text fields across the application
03 апр 2026, 19:24
03 апр 2026, 19:24
6dd59b3
Код
Авторство
О чём код?
from django import forms from django.utils.translation import gettext_lazy as _ from django.core.validators import MaxLengthValidator class FeedbackForm(forms.Form): subject = forms.CharField( label=_('Specify the subject:'), max_length=200, widget=forms.TextInput( attrs={'placeholder': _('Bug, suggestion, etc.')} ) ) contact = forms.CharField( label=_('* Your email or Telegram (@username):'), max_length=200, widget=forms.TextInput( attrs={'placeholder': 'email@example.com or @username'} ) ) message = forms.CharField( label=_('* Message:'), widget=forms.Textarea(attrs={ 'rows': 5, 'placeholder': _('Describe your issue or suggestion...') }), validators=[MaxLengthValidator(20000)] )