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:
@@ -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
|
||||
|
||||
@@ -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)))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user