MCPcopy
hub / github.com/django/django / check_ogr_fld

Method check_ogr_fld

django/contrib/gis/utils/layermapping.py:210–217  ·  view source on GitHub ↗
(ogr_map_fld)

Source from the content-addressed store, hash-verified

208
209 # Function for determining if the OGR mapping field is in the Layer.
210 def check_ogr_fld(ogr_map_fld):
211 try:
212 idx = ogr_fields.index(ogr_map_fld)
213 except ValueError:
214 raise LayerMapError(
215 'Given mapping OGR field "%s" not found in OGR Layer.' % ogr_map_fld
216 )
217 return idx
218
219 # No need to increment through each feature in the model, simply check
220 # the Layer metadata against what was given in the mapping dictionary.

Callers

nothing calls this directly

Calls 2

LayerMapErrorClass · 0.85
indexMethod · 0.45

Tested by

no test coverage detected