GeoDjango - Docs reference FIELDS_CLASSES that do not seem to exist

Hi everyone, this is my first post on this forum! :wave:

I’m wondering about a reference in the docs for django.contrib.gis.gdal.Field.type:

Returns the OGR type of this field, as an integer. The FIELD_CLASSES dictionary maps these values onto subclasses of Field :

Source: GDAL API | Django documentation | Django

By FIELD_CLASSES, are the django.contrib.gis.gdal.field.OGRFieldTypes meant?

The OGRFieldTypes dict is likely what is meant. However, it’s actually pulling it from the ldap library that’s installed. If you follow the source code down:

That list on the GDAL site looks very similar to the dict you posted from Django. So while it likely doesn’t use that dict when accessing .type, it’s pretty close.

1 Like