add nested Meta inheritance support for forms

This commit is contained in:
Maxim Kurnikov
2019-02-20 21:52:28 +03:00
parent 2d3b5492f0
commit 14ea848dd7
5 changed files with 71 additions and 24 deletions

View File

@@ -0,0 +1,9 @@
from mypy.plugin import ClassDefContext
from mypy_django_plugin import helpers
def make_meta_nested_class_inherit_from_any(ctx: ClassDefContext) -> None:
meta_node = helpers.get_nested_meta_node_for_current_class(ctx.cls.info)
if meta_node is None:
return None
meta_node.fallback_to_any = True