Skip to content

Commit

Permalink
Override signature of query-returning methods in InheritanceManager
Browse files Browse the repository at this point in the history
  • Loading branch information
mthuurne committed Apr 5, 2024
1 parent b449625 commit fb2fc5a
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions model_utils/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,78 @@ class InheritanceManagerMixin(Generic[ModelT]):
_queryset_class = InheritanceQuerySet

if TYPE_CHECKING:
from collections.abc import Sequence

Check warning on line 228 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L228

Added line #L228 was not covered by tests

def none(self) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 231 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L230-L231

Added lines #L230 - L231 were not covered by tests

def all(self) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 234 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L233-L234

Added lines #L233 - L234 were not covered by tests

def filter(self, *args: Any, **kwargs: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 237 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L236-L237

Added lines #L236 - L237 were not covered by tests

def exclude(self, *args: Any, **kwargs: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 240 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L239-L240

Added lines #L239 - L240 were not covered by tests

def complex_filter(self, filter_obj: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 243 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L242-L243

Added lines #L242 - L243 were not covered by tests

def union(self, *other_qs: Any, all: bool = ...) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 246 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L245-L246

Added lines #L245 - L246 were not covered by tests

def intersection(self, *other_qs: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 249 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L248-L249

Added lines #L248 - L249 were not covered by tests

def difference(self, *other_qs: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 252 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L251-L252

Added lines #L251 - L252 were not covered by tests

def select_for_update(

Check warning on line 254 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L254

Added line #L254 was not covered by tests
self, nowait: bool = ..., skip_locked: bool = ..., of: Sequence[str] = ..., no_key: bool = ...
) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 257 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L257

Added line #L257 was not covered by tests

def select_related(self, *fields: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 260 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L259-L260

Added lines #L259 - L260 were not covered by tests

def prefetch_related(self, *lookups: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 263 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L262-L263

Added lines #L262 - L263 were not covered by tests

def annotate(self, *args: Any, **kwargs: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 266 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L265-L266

Added lines #L265 - L266 were not covered by tests

def alias(self, *args: Any, **kwargs: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 269 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L268-L269

Added lines #L268 - L269 were not covered by tests

def order_by(self, *field_names: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 272 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L271-L272

Added lines #L271 - L272 were not covered by tests

def distinct(self, *field_names: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 275 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L274-L275

Added lines #L274 - L275 were not covered by tests

def extra(

Check warning on line 277 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L277

Added line #L277 was not covered by tests
self,
select: dict[str, Any] | None = ...,
where: list[str] | None = ...,
params: list[Any] | None = ...,
tables: list[str] | None = ...,
order_by: Sequence[str] | None = ...,
select_params: Sequence[Any] | None = ...,
) -> InheritanceQuerySet[Any]:
...

Check warning on line 286 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L286

Added line #L286 was not covered by tests

def reverse(self) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 289 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L288-L289

Added lines #L288 - L289 were not covered by tests

def defer(self, *fields: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 292 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L291-L292

Added lines #L291 - L292 were not covered by tests

def only(self, *fields: Any) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 295 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L294-L295

Added lines #L294 - L295 were not covered by tests

def using(self, alias: str | None) -> InheritanceQuerySet[ModelT]:
...

Check warning on line 298 in model_utils/managers.py

View check run for this annotation

Codecov / codecov/patch

model_utils/managers.py#L297-L298

Added lines #L297 - L298 were not covered by tests

def get_queryset(self) -> InheritanceQuerySet[ModelT]:
model: type[ModelT] = self.model # type: ignore[attr-defined]
return self._queryset_class(model)
Expand Down

0 comments on commit fb2fc5a

Please sign in to comment.