Skip to content

MultiPolygonField, PolygonField has no attribute "srid" #1325

@StefanBrand

Description

@StefanBrand

Bug report

What's wrong

error: Item "MultiPolygonField" of "Union[MultiPolygonField, PolygonField]" has no attribute "srid"  [union-attr]
error: Item "PolygonField" of "Union[MultiPolygonField, PolygonField]" has no attribute "srid"  [union-attr]

How is that should be

At runtime, PolygonField has a srid attribute that is of type int.

>>> type(self.geometry_field.srid)
<class 'int'>

Also see the Django source, where BaseSpatialField has the srid attribute:

https://github.com/django/django/blob/main/django/contrib/gis/db/models/fields.py#L72-L104

System information

  • OS: Docker image python:3.9.16-bullseye
  • python version: 3.9.16
  • django version: 4.1.4
  • mypy version: 0-991
  • django-stubs version: 1.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersstubsIssues in stubs files (.pyi)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions