Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
intgr authored Oct 18, 2023
1 parent 0c97249 commit 9010b5f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions django-stubs/contrib/gis/db/models/fields.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class GeometryField(BaseSpatialField[_ST, _GT]):
error_messages: _ErrorMessagesMapping | None = ...,
) -> None: ...
def formfield( # type: ignore[override]
self, form_class: type[forms.GeometryField] | None = ..., geom_type: str = ..., srid: Any = ..., **kwargs: Any
) -> forms.GeometryField: ...
self, *, form_class: type[GeometryField] | None = ..., geom_type: str = ..., srid: Any = ..., **kwargs: Any
) -> GeometryField: ...
def select_format(self, compiler: Any, sql: Any, params: Any) -> Any: ...

class PointField(GeometryField[_ST, _GT]):
Expand Down
4 changes: 2 additions & 2 deletions django-stubs/db/models/fields/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ class Field(RegisterLookupMixin, Generic[_ST, _GT]):
# TODO: plugin support
def formfield(
self,
form_class: type[forms.Field] | None = ...,
form_class: type[Field] | None = ...,
choices_form_class: type[forms.ChoiceField] | None = ...,
**kwargs: Any,
) -> forms.Field: ...
) -> 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: ...
Expand Down
4 changes: 0 additions & 4 deletions scripts/stubtest/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ django.contrib.auth.migrations.*
django.contrib.flatpages.migrations.*
django.contrib.contenttypes.migrations.*

# Annotate optional parameters which Django accepts as **kwargs
django.contrib.gis.db.models.GeometryField.formfield
django.contrib.gis.db.models.fields.GeometryField.formfield

# default_storage is actually an instance of DefaultStorage, but it proxies through to a Storage
django.core.files.storage.default_storage

Expand Down

0 comments on commit 9010b5f

Please sign in to comment.