mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-11-04 19:42:50 +08:00
more values(), values_list() cases
This commit is contained in:
1 parent
b81fbdeaa9
commit
0e72b2e6fc
8 files changed
+187
-42
No files matched your search
@@ -59,7 +59,9 @@ def redefine_and_typecheck_model_init(ctx: FunctionContext, django_context: Djan
|
||||
|
||||
|
||||
def redefine_and_typecheck_model_create(ctx: MethodContext, django_context: DjangoContext) -> MypyType:
|
||||
isinstance(ctx.default_return_type, Instance)
|
||||
if not isinstance(ctx.default_return_type, Instance):
|
||||
# only work with ctx.default_return_type = model Instance
|
||||
return ctx.default_return_type
|
||||
|
||||
model_fullname = ctx.default_return_type.type.fullname()
|
||||
model_cls = django_context.get_model_class_by_fullname(model_fullname)
|
||||
|
||||
Reference in new issue
Block a user