Author: jdunck
Date: 2007-07-04 01:52:40 -0500 (Wed, 04 Jul 2007)
New Revision: 5604
Modified:
django/branches/gis/django/contrib/gis/gdal/Feature.py
Log:
gis: Return field value from Feature.get based on either field name or the
field itself.
Modified: django/branches/gis/django/contrib/gis/gdal/Feature.py
===================================================================
--- django/branches/gis/django/contrib/gis/gdal/Feature.py 2007-07-04
06:50:23 UTC (rev 5603)
+++ django/branches/gis/django/contrib/gis/gdal/Feature.py 2007-07-04
06:52:40 UTC (rev 5604)
@@ -93,8 +93,9 @@
return OGRGeomType(lgdal.OGR_FD_GetGeomType(self._fdefn))
#### Feature Methods ####
- def get(self, field_name):
+ def get(self, field):
"Returns the value of the field, instead of an instance of the Field
object."
+ field_name = getattr(field, 'name', field)
return self.__getitem__(field_name).value
def index(self, field_name):
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---