mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed "indentation is not a multiple of four" pep8 issues.
This commit is contained in:
@@ -28,7 +28,7 @@ def lookup_needs_distinct(opts, lookup_path):
|
||||
isinstance(field.rel, models.ManyToManyRel)) or
|
||||
(isinstance(field, models.related.RelatedObject) and
|
||||
not field.field.unique)):
|
||||
return True
|
||||
return True
|
||||
return False
|
||||
|
||||
def prepare_lookup_value(key, value):
|
||||
|
||||
@@ -252,10 +252,10 @@ def wkb_r():
|
||||
return thread_context.wkb_r
|
||||
|
||||
def wkb_w(dim=2):
|
||||
if not thread_context.wkb_w:
|
||||
thread_context.wkb_w = WKBWriter()
|
||||
thread_context.wkb_w.outdim = dim
|
||||
return thread_context.wkb_w
|
||||
if not thread_context.wkb_w:
|
||||
thread_context.wkb_w = WKBWriter()
|
||||
thread_context.wkb_w.outdim = dim
|
||||
return thread_context.wkb_w
|
||||
|
||||
def ewkb_w(dim=2):
|
||||
if not thread_context.ewkb_w:
|
||||
|
||||
@@ -58,14 +58,14 @@ class GeoRegressionTests(TestCase):
|
||||
self.assertEqual(founded, PennsylvaniaCity.objects.aggregate(Min('founded'))['founded__min'])
|
||||
|
||||
def test_empty_count(self):
|
||||
"Testing that PostGISAdapter.__eq__ does check empty strings. See #13670."
|
||||
# contrived example, but need a geo lookup paired with an id__in lookup
|
||||
pueblo = City.objects.get(name='Pueblo')
|
||||
state = State.objects.filter(poly__contains=pueblo.point)
|
||||
cities_within_state = City.objects.filter(id__in=state)
|
||||
"Testing that PostGISAdapter.__eq__ does check empty strings. See #13670."
|
||||
# contrived example, but need a geo lookup paired with an id__in lookup
|
||||
pueblo = City.objects.get(name='Pueblo')
|
||||
state = State.objects.filter(poly__contains=pueblo.point)
|
||||
cities_within_state = City.objects.filter(id__in=state)
|
||||
|
||||
# .count() should not throw TypeError in __eq__
|
||||
self.assertEqual(cities_within_state.count(), 1)
|
||||
# .count() should not throw TypeError in __eq__
|
||||
self.assertEqual(cities_within_state.count(), 1)
|
||||
|
||||
def test_defer_or_only_with_annotate(self):
|
||||
"Regression for #16409. Make sure defer() and only() work with annotate()"
|
||||
|
||||
@@ -31,14 +31,15 @@ def add_level_messages(storage):
|
||||
|
||||
|
||||
class override_settings_tags(override_settings):
|
||||
def enable(self):
|
||||
def enable(self):
|
||||
super(override_settings_tags, self).enable()
|
||||
# LEVEL_TAGS is a constant defined in the
|
||||
# django.contrib.messages.storage.base module, so after changing
|
||||
# settings.MESSAGE_TAGS, we need to update that constant too.
|
||||
self.old_level_tags = base.LEVEL_TAGS
|
||||
base.LEVEL_TAGS = utils.get_level_tags()
|
||||
def disable(self):
|
||||
|
||||
def disable(self):
|
||||
super(override_settings_tags, self).disable()
|
||||
base.LEVEL_TAGS = self.old_level_tags
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ def getInnerText(node):
|
||||
elif child.nodeType == child.ELEMENT_NODE:
|
||||
inner_text.extend(getInnerText(child))
|
||||
else:
|
||||
pass
|
||||
pass
|
||||
return "".join(inner_text)
|
||||
|
||||
|
||||
|
||||
@@ -670,7 +670,7 @@ def parse_accept_lang_header(lang_string):
|
||||
if priority:
|
||||
priority = float(priority)
|
||||
if not priority: # if priority is 0.0 at this point make it 1.0
|
||||
priority = 1.0
|
||||
priority = 1.0
|
||||
result.append((lang, priority))
|
||||
result.sort(key=lambda k: k[1], reverse=True)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user