diff --git a/django_sql_tagger/tagging.py b/django_sql_tagger/tagging.py index cdb5cc3..06f42a2 100644 --- a/django_sql_tagger/tagging.py +++ b/django_sql_tagger/tagging.py @@ -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__) @@ -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: