1
1
from collections import OrderedDict
2
- from typing import List , Optional , Sequence , Type , Union
2
+ from typing import List , Optional , Sequence , Type
3
3
4
4
from django .core .exceptions import FieldError
5
5
from django .db .models .base import Model
@@ -62,7 +62,7 @@ def get_field_type_from_lookup(ctx: MethodContext, django_context: DjangoContext
62
62
63
63
def get_values_list_row_type (ctx : MethodContext , django_context : DjangoContext , model_cls : Type [Model ],
64
64
flat : bool , named : bool ) -> MypyType :
65
- field_lookups = resolve_field_lookups (ctx .args [0 ], ctx , django_context )
65
+ field_lookups = resolve_field_lookups (ctx .args [0 ], django_context )
66
66
if field_lookups is None :
67
67
return AnyType (TypeOfAny .from_error )
68
68
@@ -148,11 +148,10 @@ def extract_proper_type_queryset_values_list(ctx: MethodContext, django_context:
148
148
return helpers .reparametrize_instance (ctx .default_return_type , [model_type , row_type ])
149
149
150
150
151
- def resolve_field_lookups (lookup_exprs : Sequence [Expression ], ctx : Union [FunctionContext , MethodContext ],
152
- django_context : DjangoContext ) -> Optional [List [str ]]:
151
+ def resolve_field_lookups (lookup_exprs : Sequence [Expression ], django_context : DjangoContext ) -> Optional [List [str ]]:
153
152
field_lookups = []
154
153
for field_lookup_expr in lookup_exprs :
155
- field_lookup = helpers .resolve_string_attribute_value (field_lookup_expr , ctx , django_context )
154
+ field_lookup = helpers .resolve_string_attribute_value (field_lookup_expr , django_context )
156
155
if field_lookup is None :
157
156
return None
158
157
field_lookups .append (field_lookup )
@@ -172,7 +171,7 @@ def extract_proper_type_queryset_values(ctx: MethodContext, django_context: Djan
172
171
if model_cls is None :
173
172
return ctx .default_return_type
174
173
175
- field_lookups = resolve_field_lookups (ctx .args [0 ], ctx , django_context )
174
+ field_lookups = resolve_field_lookups (ctx .args [0 ], django_context )
176
175
if field_lookups is None :
177
176
return AnyType (TypeOfAny .from_error )
178
177
0 commit comments