1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from bootstrap3.tests import TestForm
RADIO_CHOICES = (
('1', 'Radio 1'),
('2', 'Radio 2'),
)
MEDIA_CHOICES = (
('Audio', (
('vinyl', 'Vinyl'),
('cd', 'CD'),
)
),
('Video', (
('vhs', 'VHS Tape'),
('dvd', 'DVD'),
)
),
('unknown', 'Unknown'),
)
class ContactForm(TestForm):
pass
class FilesForm(forms.Form):
text1 = forms.CharField()
file1 = forms.FileField()
file2 = forms.FileField(required=False)
file3 = forms.FileField(widget=forms.ClearableFileInput)
file4 = forms.FileField(required=False, widget=forms.ClearableFileInput)
|