#15277 closed Bug (fixed)
TypeError in ogrinspect geodjango gis
Reported by: | Owned by: | willi | |
---|---|---|---|
Component: | GIS | Version: | 1.2 |
Severity: | Normal | Keywords: | ogrinspect, geodjango OFTTime TypeError |
Cc: | willi, john@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I got an error when using
python manage.py ogrinspect PG:"dbname='thedbname' host='localhost' port='5432' user='theuser' password='thepassword'" MyModel --layer=thelayer --mapping --multi
there is a table with a column of type "time" in the database and the error when running the command above:
File "PATH_TO_VENV\venv\Lib\site-packages\django\contrib\gis\utils\ogrinspect.py", line 195, in _ogrinspect raise TypeError('Unknown field type %s in %s' % (field_type, mfield)) TypeError: Unknown field type <class 'django.contrib.gis.gdal.field.OFTTime'> in thelayer_time
-->
the bug seems to be in ogrinspect.py line 192:
elif field_type is OFTDate:
change:
elif field_type is OFTTime:
Attachments (4)
Change History (9)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
by , 13 years ago
Attachment: | 15277.1.patch added |
---|
comment:3 by , 13 years ago
Cc: | added |
---|---|
Easy pickings: | unset |
Has patch: | set |
UI/UX: | unset |
by , 13 years ago
Attachment: | 15277.2.patch added |
---|
by , 13 years ago
Attachment: | 15277.3.patch added |
---|
by , 13 years ago
Attachment: | 15277.4.patch added |
---|
Test TimeField by having GDAL inspect a geo database model
Note:
See TracTickets
for help on using tickets.
Adds ogrinspect tests (though we are unable to currently generate a shapefile with a OGRTime field)