def toFieldValue(self, value):
        if value is None or value == ('0', '0'):
            return self.field.missing_value

        if IGeolocation.providedBy(value):
            return value

        return Geolocation(value[0], value[1])
Example #2
0
    def toFieldValue(self, value):
        if value is None or value == (0, 0):
            return self.field.missing_value

        if IGeolocation.providedBy(value):
            return value

        return Geolocation(value[0], value[1])
Example #3
0
 def get_data(row, i):
     data = row.get(i, '')
     if self._is_file_data(data):
         return data.filename
     elif IGeolocation.providedBy(data):
         return (data.latitude, data.longitude)
     if isinstance(data, unicode):
         return data.encode('utf-8')
     return data