Skip to content

Commit

Permalink
Remove a bunch of unused code (#1687)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaeppe authored Sep 7, 2023
1 parent 0288263 commit 390cbab
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
4 changes: 0 additions & 4 deletions mypy_django_plugin/django/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,6 @@ def all_registered_model_classes(self) -> Set[Type[models.Model]]:
def all_registered_model_class_fullnames(self) -> Set[str]:
return {helpers.get_class_fullname(cls) for cls in self.all_registered_model_classes}

def get_attname(self, field: "Field[Any, Any]") -> str:
attname = field.attname
return attname

def get_field_nullability(self, field: Union["Field[Any, Any]", ForeignObjectRel], method: Optional[str]) -> bool:
if method in ("values", "values_list"):
return field.null
Expand Down
4 changes: 0 additions & 4 deletions mypy_django_plugin/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ class IncompleteDefnException(Exception):
pass


def is_toml(filename: str) -> bool:
return filename.lower().endswith(".toml")


def lookup_fully_qualified_sym(fullname: str, all_modules: Dict[str, MypyFile]) -> Optional[SymbolTableNode]:
if "." not in fullname:
return None
Expand Down
9 changes: 0 additions & 9 deletions mypy_django_plugin/transformers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,6 @@ def run_with_model_cls(self, model_cls: Type[Model]) -> None:


class AddManagers(ModelClassInitializer):
def has_any_parametrized_manager_as_base(self, info: TypeInfo) -> bool:
for base in helpers.iter_bases(info):
if self.is_any_parametrized_manager(base):
return True
return False

def is_any_parametrized_manager(self, typ: Instance) -> bool:
return typ.type.fullname in fullnames.MANAGER_CLASSES and isinstance(typ.args[0], AnyType)

def lookup_manager(self, fullname: str, manager: "Manager[Any]") -> Optional[TypeInfo]:
manager_info = self.lookup_typeinfo(fullname)
if manager_info is None:
Expand Down

0 comments on commit 390cbab

Please sign in to comment.