diff --git a/src/sentry/db/models/manager/base_query_set.py b/src/sentry/db/models/manager/base_query_set.py index dcd21db6e65c87..538192ed5fc018 100644 --- a/src/sentry/db/models/manager/base_query_set.py +++ b/src/sentry/db/models/manager/base_query_set.py @@ -7,11 +7,11 @@ from django.db import connections, router, transaction from django.db.models import QuerySet, sql -from sentry.db.models.manager.types import M +from sentry.db.models.manager.types import M, R from sentry.signals import post_update -class BaseQuerySet(QuerySet[M]): +class BaseQuerySet(QuerySet[M, R]): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) self._with_post_update_signal = False diff --git a/src/sentry/db/models/manager/types.py b/src/sentry/db/models/manager/types.py index b5aa9b1e5bccd8..7f4baf1fbb918d 100644 --- a/src/sentry/db/models/manager/types.py +++ b/src/sentry/db/models/manager/types.py @@ -1,7 +1,7 @@ from __future__ import annotations -from typing import TypeVar - from django.db.models import Model +from typing_extensions import TypeVar M = TypeVar("M", bound=Model, covariant=True) +R = TypeVar("R", covariant=True, default=M)