diff options
Diffstat (limited to 'chimere/utils.py')
-rw-r--r-- | chimere/utils.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/chimere/utils.py b/chimere/utils.py index fe1a8a1..c4e882b 100644 --- a/chimere/utils.py +++ b/chimere/utils.py @@ -241,6 +241,7 @@ class KMLManager(ImportManager): pl_id = placemark.attrib.get('id') pl_key = 'kml-%d' % self.importer_instance.pk ns = '{%s}' % self.ns + description = '' for item in placemark: if item.tag == ns + 'name': name = item.text @@ -248,7 +249,8 @@ class KMLManager(ImportManager): # if no ID is provided assume that name is a key pl_id = name elif item.tag == ns + 'description': - description = item.text + if self.importer_instance.get_description: + description = item.text elif item.tag == ns + 'Point': for coord in item: if coord.tag == ns + 'coordinates': @@ -510,7 +512,10 @@ class CSVManager(ImportManager): if len(row) < len(cols): continue pk, name, cats, state = row[0], row[1], row[2], row[3] - description, geom = row[4], row[5] + geom = row[5] + description = '' + if self.importer_instance.get_description: + description = row[4] COL_INDEX = 6 dct = {'description':description, 'name':name, @@ -599,10 +604,11 @@ class GeoRSSManager(ImportManager): y = item['geo_lat'] x = item['geo_long'] dct['point'] = 'SRID=4326;POINT(%s %s)' % (x, y) - for k in ['description', 'summary', 'value']: - if k in item: - dct['description'] = item[k] - break + if self.importer_instance.get_description: + for k in ['description', 'summary', 'value']: + if k in item: + dct['description'] = item[k] + break else: cls = Route points = item['georss_line'].split(' ') |