=== modified file 'django/newforms/extras/widgets.py'
|
|
|
2 | 2 | Extra HTML Widget classes |
3 | 3 | """ |
4 | 4 | |
| 5 | import datetime |
| 6 | |
5 | 7 | from django.newforms.widgets import Widget, Select |
6 | 8 | from django.utils.dates import MONTHS |
7 | | import datetime |
8 | 9 | |
9 | 10 | __all__ = ('SelectDateWidget',) |
10 | 11 | |
=== modified file 'django/newforms/fields.py'
|
|
|
2 | 2 | Field classes |
3 | 3 | """ |
4 | 4 | |
| 5 | import datetime |
| 6 | import re |
| 7 | import time |
| 8 | |
5 | 9 | from django.utils.translation import gettext |
6 | 10 | from django.utils.encoding import smart_unicode |
| 11 | |
7 | 12 | from util import ErrorList, ValidationError |
8 | 13 | from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple |
9 | | import datetime |
10 | | import re |
11 | | import time |
12 | 14 | |
13 | 15 | __all__ = ( |
14 | 16 | 'Field', 'CharField', 'IntegerField', |
=== modified file 'django/newforms/forms.py'
|
|
|
2 | 2 | Form classes |
3 | 3 | """ |
4 | 4 | |
5 | | from django.utils.datastructures import SortedDict, MultiValueDict |
| 5 | import copy |
| 6 | |
| 7 | from django.utils.datastructures import SortedDict |
6 | 8 | from django.utils.html import escape |
7 | 9 | from django.utils.encoding import StrAndUnicode |
| 10 | |
8 | 11 | from fields import Field |
9 | | from widgets import TextInput, Textarea, HiddenInput, MultipleHiddenInput |
| 12 | from widgets import TextInput, Textarea |
10 | 13 | from util import flatatt, ErrorDict, ErrorList, ValidationError |
11 | | import copy |
12 | 14 | |
13 | 15 | __all__ = ('BaseForm', 'Form') |
14 | 16 | |
=== modified file 'django/newforms/models.py'
|
|
|
4 | 4 | """ |
5 | 5 | |
6 | 6 | from django.utils.translation import gettext |
| 7 | |
7 | 8 | from util import ValidationError |
8 | | from forms import BaseForm, DeclarativeFieldsMetaclass, SortedDictFromList |
| 9 | from forms import BaseForm, SortedDictFromList |
9 | 10 | from fields import Field, ChoiceField |
10 | 11 | from widgets import Select, SelectMultiple, MultipleHiddenInput |
11 | 12 | |
12 | | __all__ = ('save_instance', 'form_for_model', 'form_for_instance', 'form_for_fields', |
13 | | 'ModelChoiceField', 'ModelMultipleChoiceField') |
| 13 | __all__ = ( |
| 14 | 'save_instance', 'form_for_model', 'form_for_instance', 'form_for_fields', |
| 15 | 'ModelChoiceField', 'ModelMultipleChoiceField' |
| 16 | ) |
14 | 17 | |
15 | 18 | def save_instance(form, instance, fields=None, fail_message='saved', commit=True): |
16 | 19 | """ |
=== modified file 'django/newforms/util.py'
|
|
|
1 | | from django.conf import settings |
2 | 1 | from django.utils.html import escape |
3 | | from django.utils.functional import Promise, lazy |
4 | 2 | from django.utils.encoding import smart_unicode |
5 | 3 | |
6 | 4 | # Converts a dictionary to a single string with key="value", XML-style with |
=== modified file 'django/newforms/widgets.py'
|
|
|
2 | 2 | HTML Widget classes |
3 | 3 | """ |
4 | 4 | |
5 | | __all__ = ( |
6 | | 'Widget', 'TextInput', 'PasswordInput', 'HiddenInput', 'MultipleHiddenInput', |
7 | | 'FileInput', 'Textarea', 'CheckboxInput', |
8 | | 'Select', 'NullBooleanSelect', 'SelectMultiple', 'RadioSelect', 'CheckboxSelectMultiple', |
9 | | 'MultiWidget', 'SplitDateTimeWidget', |
10 | | ) |
| 5 | try: |
| 6 | set # Only available in Python 2.4+ |
| 7 | except NameError: |
| 8 | from sets import Set as set # Python 2.3 fallback |
| 9 | from itertools import chain |
11 | 10 | |
12 | | from util import flatatt |
13 | 11 | from django.utils.datastructures import MultiValueDict |
14 | 12 | from django.utils.html import escape |
15 | 13 | from django.utils.translation import gettext |
16 | 14 | from django.utils.encoding import StrAndUnicode, smart_unicode |
17 | | from itertools import chain |
18 | | |
19 | | try: |
20 | | set # Only available in Python 2.4+ |
21 | | except NameError: |
22 | | from sets import Set as set # Python 2.3 fallback |
| 15 | |
| 16 | from util import flatatt |
| 17 | |
| 18 | __all__ = ( |
| 19 | 'Widget', 'TextInput', 'PasswordInput', |
| 20 | 'HiddenInput', 'MultipleHiddenInput', |
| 21 | 'FileInput', 'Textarea', 'CheckboxInput', |
| 22 | 'Select', 'NullBooleanSelect', 'SelectMultiple', 'RadioSelect', |
| 23 | 'CheckboxSelectMultiple', 'MultiWidget', 'SplitDateTimeWidget', |
| 24 | ) |
23 | 25 | |
24 | 26 | class Widget(object): |
25 | 27 | is_hidden = False # Determines whether this corresponds to an <input type="hidden">. |