Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fallback related manager in final iteration of AddRelatedManagers
If a django model has a Manager class that cannot be resolved on runtime (like django-money monkeypatches all default managers after models already have been declared, and generates this manager as the return value of a function, so it cannot be imported when we try to set up the default related managers in AddDefaultManagerAttribute), we fallback to a default related manager, so you at least get a base level of working type checking.
- Loading branch information
Showing
2 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from mypy.errorcodes import ErrorCode | ||
|
||
MANAGER_UNTYPED = ErrorCode("django-manager", "Untyped manager disallowed", "Django") | ||
MANAGER_MISSING = ErrorCode("django-manager-missing", "Couldn't resolve manager for model", "Django") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters