summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/extras/widgets.py2
-rw-r--r--django/forms/formsets.py2
-rw-r--r--django/forms/models.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/django/forms/extras/widgets.py b/django/forms/extras/widgets.py
index 95831679b8..7fd209f397 100644
--- a/django/forms/extras/widgets.py
+++ b/django/forms/extras/widgets.py
@@ -62,7 +62,7 @@ class SelectDateWidget(Widget):
self.years = years
else:
this_year = datetime.date.today().year
- self.years = range(this_year, this_year+10)
+ self.years = range(this_year, this_year + 10)
# Optional dict of months to use in the "month" select box.
if months:
diff --git a/django/forms/formsets.py b/django/forms/formsets.py
index 9c8b790d59..625f597117 100644
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -363,7 +363,7 @@ class BaseFormSet(object):
if self.can_order:
# Only pre-fill the ordering field for initial forms.
if index is not None and index < self.initial_form_count():
- form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_('Order'), initial=index+1, required=False)
+ form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_('Order'), initial=index + 1, required=False)
else:
form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_('Order'), required=False)
if self.can_delete:
diff --git a/django/forms/models.py b/django/forms/models.py
index 32f0f043ae..6d9a567926 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -572,7 +572,7 @@ class BaseModelFormSet(BaseFormSet):
if i >= self.initial_form_count() and self.initial_extra:
# Set initial values for extra forms
try:
- kwargs['initial'] = self.initial_extra[i-self.initial_form_count()]
+ kwargs['initial'] = self.initial_extra[i - self.initial_form_count()]
except IndexError:
pass
return super(BaseModelFormSet, self)._construct_form(i, **kwargs)