Skip to content

Commit

Permalink
Include Manager in the framework classes
Browse files Browse the repository at this point in the history
  • Loading branch information
crabhi committed Feb 27, 2024
1 parent a58d5ad commit 701d584
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django_sql_tagger/tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from types import FrameType, CodeType

from django.conf import settings
from django.db.models import QuerySet, Model
from django.db.models import QuerySet, Model, Manager

transaction_tag = threading.local()
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -72,8 +72,8 @@ def sql_query_tagger(execute, sql, params, many, context):
_cls = calling_frame.f_locals.get('cls')
if (
(not is_code_ours(calling_frame.f_code))
or (isinstance(calling_frame.f_locals.get('self'), (QuerySet, Model)))
or (_cls and inspect.isclass(_cls) and issubclass(_cls, (QuerySet, Model)))
or (isinstance(calling_frame.f_locals.get('self'), (QuerySet, Model, Manager)))
or (_cls and inspect.isclass(_cls) and issubclass(_cls, (QuerySet, Model, Manager)))
):
calling_frame = calling_frame.f_back
else:
Expand Down

0 comments on commit 701d584

Please sign in to comment.