diff --git a/django-stubs/contrib/gis/db/models/fields.pyi b/django-stubs/contrib/gis/db/models/fields.pyi index 9de810933..30e061930 100644 --- a/django-stubs/contrib/gis/db/models/fields.pyi +++ b/django-stubs/contrib/gis/db/models/fields.pyi @@ -109,8 +109,13 @@ class GeometryField(BaseSpatialField[_ST, _GT]): error_messages: _ErrorMessagesMapping | None = ..., ) -> None: ... def formfield( # type: ignore[override] - self, *, form_class: type[GeometryField] | None = ..., geom_type: str = ..., srid: Any = ..., **kwargs: Any - ) -> GeometryField: ... + self, + *, + form_class: type[forms.GeometryField] | None = ..., + geom_type: str = ..., + srid: Any = ..., + **kwargs: Any, + ) -> forms.GeometryField: ... def select_format(self, compiler: Any, sql: Any, params: Any) -> Any: ... class PointField(GeometryField[_ST, _GT]): diff --git a/django-stubs/db/models/fields/__init__.pyi b/django-stubs/db/models/fields/__init__.pyi index 471245bf8..279131eca 100644 --- a/django-stubs/db/models/fields/__init__.pyi +++ b/django-stubs/db/models/fields/__init__.pyi @@ -205,10 +205,10 @@ class Field(RegisterLookupMixin, Generic[_ST, _GT]): # TODO: plugin support def formfield( self, - form_class: type[Field] | None = ..., + form_class: type[forms.Field] | None = ..., choices_form_class: type[forms.ChoiceField] | None = ..., **kwargs: Any, - ) -> Field: ... + ) -> forms.Field: ... def save_form_data(self, instance: Model, data: Any) -> None: ... def contribute_to_class(self, cls: type[Model], name: str, private_only: bool = ...) -> None: ... def to_python(self, value: Any) -> Any: ...