def index(self, field_name): "Returns the index of the given field name." i = get_field_index(self._ptr, field_name) if i < 0: raise OGRIndexError('invalid OFT field name given: "%s"' % field_name) return i
def index(self, field_name): "Returns the index of the given field name." i = capi.get_field_index(self.ptr, force_bytes(field_name)) if i < 0: raise OGRIndexError('invalid OFT field name given: "%s"' % field_name) return i
def index(self, field_name): "Returns the index of the given field name." i = capi.get_field_index(self.ptr, force_bytes(field_name)) if i < 0: raise OGRIndexError( 'invalid OFT field name given: "%s"' % field_name) return i
from django.contrib.gis.gdal.base import GDALBase
def index(self, field_name): "Return the index of the given field name." i = capi.get_field_index(self.ptr, force_bytes(field_name)) if i < 0: raise IndexError("Invalid OFT field name given: %s." % field_name) return i
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 return OGRGeomType(capi.get_fd_geom_type(self._layer._ldefn)) # #### Feature Methods #### def get(self, field): """ <<<<<<< HEAD Returns the value of the field, instead of an instance of the Field ======= Return the value of the field, instead of an instance of the Field >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 object. May take a string of the field name or a Field object as parameters. """ field_name = getattr(field, 'name', field) return self[field_name].value def index(self, field_name): <<<<<<< HEAD "Returns the index of the given field name." i = capi.get_field_index(self.ptr, force_bytes(field_name)) if i < 0: raise OGRIndexError('invalid OFT field name given: "%s"' % field_name) ======= "Return the index of the given field name." i = capi.get_field_index(self.ptr, force_bytes(field_name)) if i < 0: raise IndexError('Invalid OFT field name given: %s.' % field_name) >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 return i