forms.py 702 B

12345678910111213141516171819202122232425262728293031
  1. from django import forms
  2. class ContactForm(forms.Form):
  3. name = forms.CharField(
  4. label="Nombre",
  5. required=True,
  6. widget=forms.TextInput(
  7. attrs={'placeholder': 'Nombre'}
  8. ),
  9. min_length=3,
  10. max_length=100)
  11. email = forms.EmailField(
  12. label="Email",
  13. required=True,
  14. widget=forms.EmailInput(
  15. attrs={'placeholder': 'user@page.domain'}
  16. ),
  17. min_length=3,
  18. max_length=100)
  19. content = forms.CharField(
  20. label="Mensaje",
  21. required=True,
  22. widget=forms.Textarea(
  23. attrs={'placeholder': 'Mensaje'}
  24. ),
  25. min_length=10,
  26. max_length=1000)