Fix ForeignKey type for self-reference defined in the abstract model (#200)

This commit is contained in:
Maxim Kurnikov
2019-10-05 21:36:29 +03:00
committed by GitHub
parent db9ff6aaf6
commit 7e3f4bfa02
6 changed files with 82 additions and 16 deletions

View File

@@ -219,7 +219,7 @@ class NewSemanalDjangoPlugin(Plugin):
def get_base_class_hook(self, fullname: str
) -> Optional[Callable[[ClassDefContext], None]]:
if (fullname in self.django_context.model_base_classes
if (fullname in self.django_context.all_registered_model_class_fullnames
or fullname in self._get_current_model_bases()):
return partial(transform_model_class, django_context=self.django_context)