Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tijani-Dia committed Aug 8, 2024
1 parent 21a7d0e commit c3fe6f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 9 additions & 7 deletions src/dj_tracker/promise.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,16 @@ def get_cache_key(
contains_calls if contains_calls else 0,
instance_trackings if instance_trackings else 0,
hash_string(iterable_class) if iterable_class else 0,
hash(
frozenset(
(hash_string(attr), count)
for attr, count in attributes_accessed.items()
(
hash(
frozenset(
(hash_string(attr), count)
for attr, count in attributes_accessed.items()
)
)
)
if attributes_accessed
else 0,
if attributes_accessed
else 0
),
related_queryset_id if related_queryset_id else 0,
)
)
Expand Down
12 changes: 6 additions & 6 deletions src/dj_tracker/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ def get_context_data(self, **kwargs):
)

# Query groups
context[
"n_plus_ones"
] = QueryGroup.objects.n_plus_one().order_by_latest_occurrence()[:6]
context[
"frequent_query_groups"
] = QueryGroup.objects.annotate_num_trackings().order_by("-num_trackings")[:5]
context["n_plus_ones"] = (
QueryGroup.objects.n_plus_one().order_by_latest_occurrence()[:6]
)
context["frequent_query_groups"] = (
QueryGroup.objects.annotate_num_trackings().order_by("-num_trackings")[:5]
)
context["largest_query_groups"] = (
QueryGroup.objects.annotate_num_queries()
.exclude(trackings__request__path__path="")
Expand Down

0 comments on commit c3fe6f1

Please sign in to comment.