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

Fixed #21298 -- Fixed E301 pep8 warnings

This commit is contained in:
Alasdair Nicol
2013-10-22 11:21:07 +01:00
parent 317040a73b
commit c3aa2948c6
83 changed files with 180 additions and 2 deletions

View File

@@ -241,6 +241,7 @@ class BaseFormSet(object):
# None should be sorted below anything else. Allowing None as
# a comparison value makes it so we can leave ordering fields
# blank.
def compare_ordering_key(k):
if k[1] is None:
return (1, 0) # +infinity, larger than any number

View File

@@ -602,6 +602,7 @@ class BaseModelFormSet(BaseFormSet):
"""
if not commit:
self.saved_forms = []
def save_m2m():
for form in self.saved_forms:
form.save_m2m()
@@ -754,6 +755,7 @@ class BaseModelFormSet(BaseFormSet):
# data back. Generally, pk.editable should be false, but for some
# reason, auto_created pk fields and AutoField's editable attribute is
# True, so check for that as well.
def pk_is_not_editable(pk):
return ((not pk.editable) or (pk.auto_created or isinstance(pk, AutoField))
or (pk.rel and pk.rel.parent_link and pk_is_not_editable(pk.rel.to._meta.pk)))

View File

@@ -406,6 +406,7 @@ class Textarea(Widget):
class DateTimeBaseInput(TextInput):
format_key = ''
def __init__(self, attrs=None, format=None):
super(DateTimeBaseInput, self).__init__(attrs)
self.format = format if format else None