|
@@ -1,16 +1,13 @@
|
1
|
1
|
import re
|
2
|
|
-from django.utils import six
|
3
|
|
-from django.utils.six.moves import filter
|
4
|
|
-from django.utils.six.moves import map
|
5
|
|
-
|
6
|
|
-import django
|
7
|
2
|
from django import forms
|
8
|
3
|
from django.core.files.uploadedfile import InMemoryUploadedFile
|
9
|
4
|
from django.forms.util import flatatt
|
10
|
5
|
from django.forms.widgets import FileInput
|
11
|
6
|
from django.template import Context
|
12
|
7
|
from django.template.loader import render_to_string
|
13
|
|
-from django.utils import formats
|
|
8
|
+from django.utils import formats, six
|
|
9
|
+from django.utils.six.moves import filter
|
|
10
|
+from django.utils.six.moves import map
|
14
|
11
|
from django.utils.encoding import force_text
|
15
|
12
|
from django.utils.html import format_html
|
16
|
13
|
from django.utils.safestring import mark_safe
|
|
@@ -121,9 +118,11 @@ class TimePickerInput(forms.TimeInput):
|
121
|
118
|
def render(self, name, value, attrs=None):
|
122
|
119
|
format = self.format
|
123
|
120
|
if hasattr(self, 'manual_format'):
|
124
|
|
- # For django <= 1.6.5, see https://code.djangoproject.com/ticket/21173
|
|
121
|
+ # For django <= 1.6.5, see
|
|
122
|
+ # https://code.djangoproject.com/ticket/21173
|
125
|
123
|
if self.is_localized and not self.manual_format:
|
126
|
|
- format = force_text(formats.get_format('DATE_INPUT_FORMATS')[0])
|
|
124
|
+ format = force_text(
|
|
125
|
+ formats.get_format('DATE_INPUT_FORMATS')[0])
|
127
|
126
|
else:
|
128
|
127
|
# For django >= 1.7
|
129
|
128
|
format = format or formats.get_format(self.format_key)[0]
|
|
@@ -153,9 +152,11 @@ class DatePickerInput(forms.DateInput):
|
153
|
152
|
def render(self, name, value, attrs=None):
|
154
|
153
|
format = self.format
|
155
|
154
|
if hasattr(self, 'manual_format'):
|
156
|
|
- # For django <= 1.6.5, see https://code.djangoproject.com/ticket/21173
|
|
155
|
+ # For django <= 1.6.5, see
|
|
156
|
+ # https://code.djangoproject.com/ticket/21173
|
157
|
157
|
if self.is_localized and not self.manual_format:
|
158
|
|
- format = force_text(formats.get_format('DATE_INPUT_FORMATS')[0])
|
|
158
|
+ format = force_text(
|
|
159
|
+ formats.get_format('DATE_INPUT_FORMATS')[0])
|
159
|
160
|
else:
|
160
|
161
|
# For django >= 1.7
|
161
|
162
|
format = format or formats.get_format(self.format_key)[0]
|
|
@@ -199,9 +200,11 @@ class DateTimePickerInput(forms.DateTimeInput):
|
199
|
200
|
def render(self, name, value, attrs=None):
|
200
|
201
|
format = self.format
|
201
|
202
|
if hasattr(self, 'manual_format'):
|
202
|
|
- # For django <= 1.6.5, see https://code.djangoproject.com/ticket/21173
|
|
203
|
+ # For django <= 1.6.5, see
|
|
204
|
+ # https://code.djangoproject.com/ticket/21173
|
203
|
205
|
if self.is_localized and not self.manual_format:
|
204
|
|
- format = force_text(formats.get_format('DATETIME_INPUT_FORMATS')[0])
|
|
206
|
+ format = force_text(
|
|
207
|
+ formats.get_format('DATETIME_INPUT_FORMATS')[0])
|
205
|
208
|
else:
|
206
|
209
|
# For django >= 1.7
|
207
|
210
|
format = format or formats.get_format(self.format_key)[0]
|