Opened 5 years ago

Closed 5 years ago

#20758 closed Bug (invalid)

PostGISCreation failed by index creation for PointField

Reported by: Christoph Heer Owned by: nobody
Component: Database layer (models, ORM) Version: 1.5
Severity: Normal Keywords: GeoDjango, Index, Test
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I want to test my GeoDjango project but the index creation a PointField fails.

   db_type = f.db_type(connection=self.connection)
>  if db_type.startswith('varchar'):
E  AttributeError: 'NoneType' object has no attribute 'startswith'

The PointField returns only None in this state. The if statements are only relevant for VARCHAR or TEXT fields but not for Geo Fields.

Change History (1)

comment:1 Changed 5 years ago by Claude Paroz

Resolution: invalid
Status: newclosed

Indexes for geometry fields should be specified with spatial_index (which defaults to True anyway), not db_index:

Note: See TracTickets for help on using tickets.
Back to Top