mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 22:11:54 +08:00
Fix type stubs for OuterRef (#952)
* Fix error when nesting OuterRef expressions
OuterRef(OuterRef("my_field")) is a valid expression in nested
subqueries. Mypy would complain that OuterRef was an incompatible type
because OuterRef is typed to only accept str.
* Only fix for OuterRef
* OuterRef is not guaranteed to be resolved to ResolvedOuterRef
This commit is contained in:
@@ -130,8 +130,8 @@ class F(Combinable):
|
||||
class ResolvedOuterRef(F): ...
|
||||
|
||||
class OuterRef(F):
|
||||
def __init__(self, name: Union[str, OuterRef]): ...
|
||||
contains_aggregate: bool
|
||||
def resolve_expression(self, *args: Any, **kwargs: Any) -> ResolvedOuterRef: ...
|
||||
def relabeled_clone(self: _Self, relabels: Any) -> _Self: ...
|
||||
|
||||
class Subquery(BaseExpression, Combinable):
|
||||
|
||||
Reference in New Issue
Block a user