1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Correct flake8 violation E261

This commit is contained in:
Ray Ashman Jr
2013-11-02 15:27:47 -04:00
parent b44d42be6d
commit dcfc8fa972
18 changed files with 59 additions and 59 deletions

View File

@@ -45,9 +45,9 @@ __all__ = (
class Field(object):
widget = TextInput # Default widget to use when rendering this type of Field.
hidden_widget = HiddenInput # Default widget to use when rendering this as "hidden".
default_validators = [] # Default set of validators
widget = TextInput # Default widget to use when rendering this type of Field.
hidden_widget = HiddenInput # Default widget to use when rendering this as "hidden".
default_validators = [] # Default set of validators
# Add an 'invalid' entry to default_error_message if you want a specific
# field error message not raised by the field validators.
default_error_messages = {

View File

@@ -120,7 +120,7 @@ class BaseForm(object):
# Translators: This is the default suffix added to form field labels
self.label_suffix = label_suffix if label_suffix is not None else _(':')
self.empty_permitted = empty_permitted
self._errors = None # Stores the errors after clean() has been called.
self._errors = None # Stores the errors after clean() has been called.
self._changed_data = None
# The base_fields class attribute is the *class-wide* definition of
@@ -176,7 +176,7 @@ class BaseForm(object):
def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row):
"Helper function for outputting HTML. Used by as_table(), as_ul(), as_p()."
top_errors = self.non_field_errors() # Errors that should be displayed above all fields.
top_errors = self.non_field_errors() # Errors that should be displayed above all fields.
output, hidden_fields = [], []
for name, field in self.fields.items():
@@ -223,7 +223,7 @@ class BaseForm(object):
if top_errors:
output.insert(0, error_row % force_text(top_errors))
if hidden_fields: # Insert any hidden fields in the last row.
if hidden_fields: # Insert any hidden fields in the last row.
str_hidden = ''.join(hidden_fields)
if output:
last_row = output[-1]
@@ -295,7 +295,7 @@ class BaseForm(object):
self.cleaned_data.
"""
self._errors = ErrorDict()
if not self.is_bound: # Stop further processing.
if not self.is_bound: # Stop further processing.
return
self.cleaned_data = {}
# If the form is permitted to be empty, and none of the form data has

View File

@@ -244,7 +244,7 @@ class BaseFormSet(object):
def compare_ordering_key(k):
if k[1] is None:
return (1, 0) # +infinity, larger than any number
return (1, 0) # +infinity, larger than any number
return (0, k[1])
self._ordering.sort(key=compare_ordering_key)
# Return a list of form.cleaned_data dicts in the order specified by
@@ -316,7 +316,7 @@ class BaseFormSet(object):
self._errors = []
self._non_form_errors = self.error_class()
if not self.is_bound: # Stop further processing.
if not self.is_bound: # Stop further processing.
return
for i in range(0, self.total_form_count()):
form = self.forms[i]

View File

@@ -161,8 +161,8 @@ class SubWidget(object):
return self.parent_widget.render(*args)
class Widget(six.with_metaclass(MediaDefiningClass)):
is_hidden = False # Determines whether this corresponds to an <input type="hidden">.
needs_multipart_form = False # Determines does this widget need multipart form
is_hidden = False # Determines whether this corresponds to an <input type="hidden">.
needs_multipart_form = False # Determines does this widget need multipart form
is_localized = False
is_required = False
@@ -227,7 +227,7 @@ class Input(Widget):
Base class for all <input> widgets (except type='checkbox' and
type='radio', which are special).
"""
input_type = None # Subclasses must define this.
input_type = None # Subclasses must define this.
def _format_value(self, value):
if self.is_localized:
@@ -643,7 +643,7 @@ class ChoiceFieldRenderer(object):
self.choices = choices
def __getitem__(self, idx):
choice = self.choices[idx] # Let the IndexError propogate
choice = self.choices[idx] # Let the IndexError propogate
return self.choice_input_class(self.name, self.value, self.attrs.copy(), choice, idx)
def __str__(self):