django-stubs icon indicating copy to clipboard operation
django-stubs copied to clipboard

Add GeoModelAdminMixin

Open 93578237 opened this issue 1 year ago • 6 comments

I have made things!

https://github.com/django/django/blob/main/django/contrib/gis/admin/options.py#L6

Related issues

93578237 avatar Feb 25 '24 09:02 93578237

Should it be ignored?

error: django.contrib.gis.admin.options.GeoModelAdminMixin.gis_widget variable differs from runtime type django.forms.widgets.MediaDefiningClass Stub: in file /home/runner/work/django-stubs/django-stubs/django-stubs/contrib/gis/admin/options.pyi:13 Type[django.contrib.gis.forms.widgets.OSMWidget]

93578237 avatar Feb 25 '24 15:02 93578237

I propose to ignore it for now with a comment (in stubtest_allowlist.txt) and report it to mypy. This looks like a bug to me.

sobolevn avatar Feb 25 '24 15:02 sobolevn

Cant reproduce it https://mypy-play.net/?mypy=latest&python=3.12&flags=strict&gist=eef085e1ca215019969827514448b88b

93578237 avatar Feb 25 '24 16:02 93578237

@q0w you need stubtest, not mypy to reproduce it.

sobolevn avatar Feb 25 '24 16:02 sobolevn

Oh, ok, its reproducible

93578237 avatar Feb 25 '24 16:02 93578237

Assigned to @sobolevn. If you don't want to lead the review here, feel free to unassign yourself.

intgr avatar Mar 25 '24 10:03 intgr