Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. from django import forms
  2.  
  3. class CommentForm(forms.Form):
  4. name = forms.CharField()
  5. url = forms.URLField()
  6. comment = forms.CharField(widget=forms.Textarea)
  7.  
  8. from django import forms
  9.  
  10. BIRTH_YEAR_CHOICES = ('1980', '1981', '1982')
  11. FAVORITE_COLORS_CHOICES = (
  12. ('blue', 'Blue'),
  13. ('green', 'Green'),
  14. ('black', 'Black'),
  15. )
  16.  
  17. class SimpleForm(forms.Form):
  18. birth_year = forms.DateField(widget=forms.SelectDateWidget(years=BIRTH_YEAR_CHOICES))
  19. favorite_colors = forms.MultipleChoiceField(required=False,
  20. widget=forms.CheckboxSelectMultiple, choices=FAVORITE_COLORS_CHOICES)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement