File tree 1 file changed +5
-2
lines changed
mypy_django_plugin/transformers
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -273,14 +273,17 @@ def run_with_model_cls(self, model_cls: Type[Model]) -> None:
273
273
if isinstance (relation , (ManyToOneRel , ManyToManyRel )):
274
274
try :
275
275
related_manager_info = self .lookup_typeinfo_or_incomplete_defn_error (fullnames .RELATED_MANAGER_CLASS ) # noqa: E501
276
- if 'objects' not in related_model_info .names :
277
- raise helpers .IncompleteDefnException ()
278
276
except helpers .IncompleteDefnException as exc :
279
277
if not self .api .final_iteration :
280
278
raise exc
281
279
else :
282
280
continue
283
281
282
+ if 'objects' not in related_model_info .names :
283
+ self .add_new_node_to_model_class (
284
+ attname , Instance (related_manager_info , [Instance (related_model_info , [])]))
285
+ continue
286
+
284
287
# create new RelatedManager subclass
285
288
parametrized_related_manager_type = Instance (related_manager_info ,
286
289
[Instance (related_model_info , [])])
You can’t perform that action at this time.
0 commit comments