Skip to content

Commit b1a26e8

Browse files
committed
More formatting
1 parent 57b2d17 commit b1a26e8

File tree

5 files changed

+3
-8
lines changed

5 files changed

+3
-8
lines changed

polymorphic/formsets/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def __init__(
4141
help_texts=None,
4242
error_messages=None,
4343
):
44-
4544
self.model = model
4645

4746
# Instead of initializing the form here right away,

polymorphic/query.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def _polymorphic_iterator(self, base_iter):
5353
# Make sure the base iterator is read in chunks instead of
5454
# reading it completely, in case our caller read only a few objects.
5555
for i in range(Polymorphic_QuerySet_objects_per_request):
56-
5756
try:
5857
o = next(base_iter)
5958
base_result_objects.append(o)
@@ -258,7 +257,8 @@ def _polymorphic_add_immediate_loading(self, field_names):
258257

259258
def _process_aggregate_args(self, args, kwargs):
260259
"""for aggregate and annotate kwargs: allow ModelX___field syntax for kwargs, forbid it for args.
261-
Modifies kwargs if needed (these are Aggregate objects, we translate the lookup member variable)"""
260+
Modifies kwargs if needed (these are Aggregate objects, we translate the lookup member variable)
261+
"""
262262
___lookup_assert_msg = "PolymorphicModel: annotate()/aggregate(): ___ model lookup supported for keyword arguments only"
263263

264264
def patch_lookup(a):
@@ -386,7 +386,6 @@ class self.model, but as a class derived from self.model. We want to re-fetch
386386
).pk
387387

388388
for i, base_object in enumerate(base_result_objects):
389-
390389
if base_object.polymorphic_ctype_id == self_model_class_id:
391390
# Real class is exactly the same as base class, go straight to results
392391
resultlist.append(base_object)

polymorphic/query_translate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def translate_polymorphic_filter_definitions_in_kwargs(
4040
"""
4141
additional_args = []
4242
for field_path, val in kwargs.copy().items(): # Python 3 needs copy
43-
4443
new_expr = _translate_polymorphic_filter_definition(
4544
queryset_model, field_path, val, using=using
4645
)

polymorphic/tests/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ class ProxyModelB(ProxyModelBase):
372372
# class TestBadFieldModel(ShowFieldType, PolymorphicModel):
373373
# instance_of = models.CharField(max_length=10)
374374

375+
375376
# validation error: "polymorphic.relatednameclash: Accessor for field 'polymorphic_ctype' clashes
376377
# with related field 'ContentType.relatednameclash_set'." (reported by Andrew Ingram)
377378
# fixed with related_name
@@ -401,7 +402,6 @@ class CustomPkInherit(CustomPkBase):
401402

402403

403404
class DateModel(PolymorphicModel):
404-
405405
date = models.DateTimeField()
406406

407407

polymorphic/tests/test_orm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,6 @@ def test_polymorphic__filtered_relation(self):
10771077
self.assertIsInstance(result.last(), BlogB)
10781078

10791079
def test_polymorphic__expressions(self):
1080-
10811080
from django.db.models.functions import Concat
10821081

10831082
# no exception raised
@@ -1240,6 +1239,5 @@ def test_refresh_from_db_fields(self):
12401239
assert obj.field1 == "aa1"
12411240

12421241
def test_non_polymorphic_parent(self):
1243-
12441242
obj = NonPolymorphicParent.objects.create()
12451243
assert obj.delete()

0 commit comments

Comments
 (0)