Opened 11 years ago
Closed 11 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 |
Description
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.
Patch: https://github.com/django/django/pull/1367
Note:
See TracTickets
for help on using tickets.
Indexes for geometry fields should be specified with
spatial_index
(which defaults to True anyway), notdb_index
:https://docs.djangoproject.com/en/dev/ref/contrib/gis/model-api/#spatial-index