11from collections import OrderedDict
2- from typing import List , Optional , Sequence , Type , Union
2+ from typing import List , Optional , Sequence , Type
33
44from django .core .exceptions import FieldError
55from django .db .models .base import Model
@@ -62,7 +62,7 @@ def get_field_type_from_lookup(ctx: MethodContext, django_context: DjangoContext
6262
6363def get_values_list_row_type (ctx : MethodContext , django_context : DjangoContext , model_cls : Type [Model ],
6464 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 )
6666 if field_lookups is None :
6767 return AnyType (TypeOfAny .from_error )
6868
@@ -148,11 +148,10 @@ def extract_proper_type_queryset_values_list(ctx: MethodContext, django_context:
148148 return helpers .reparametrize_instance (ctx .default_return_type , [model_type , row_type ])
149149
150150
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 ]]:
153152 field_lookups = []
154153 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 )
156155 if field_lookup is None :
157156 return None
158157 field_lookups .append (field_lookup )
@@ -172,7 +171,7 @@ def extract_proper_type_queryset_values(ctx: MethodContext, django_context: Djan
172171 if model_cls is None :
173172 return ctx .default_return_type
174173
175- field_lookups = resolve_field_lookups (ctx .args [0 ], ctx , django_context )
174+ field_lookups = resolve_field_lookups (ctx .args [0 ], django_context )
176175 if field_lookups is None :
177176 return AnyType (TypeOfAny .from_error )
178177
0 commit comments