def stations():
 stations_strings = []
 append = stations_strings.append
 table = s3db.climate_place
 etable = s3db.climate_place_elevation
 itable = s3db.climate_place_station_id
 ntable = s3db.climate_place_station_name
 query = (((table.id == etable.id) & (table.id == itable.id)) & (table.id == ntable.id))
 rows = db(query).select(table.id, table.longitude, table.latitude, etable.elevation_metres, itable.station_id, ntable.name)
 for place_row in rows:
  append(''.join(('(', str(place_row.climate_place.id), ',{', '"longitude":', str(place_row.climate_place.longitude), ',"latitude":', str(place_row.climate_place.latitude), '}')))
 return ('[%s]' % ','.join(stations_strings))

def stations ( ) : stations_strings = [ ] append = stations_strings . append table = s3db . climate_place etable = s3db . climate_place_elevation itable = s3db . climate_place_station_id ntable = s3db . climate_place_station_name query = ( ( ( table . id == etable . id ) & ( table . id == itable . id ) ) & ( table . id == ntable . id ) ) rows = db ( query ) . select ( table . id , table . longitude , table . latitude , etable . elevation_metres , itable . station_id , ntable . name ) for place_row in rows : append ( '' . join ( ( '(' , str ( place_row . climate_place . id ) , ',{' , '"longitude":' , str ( place_row . climate_place . longitude ) , ',"latitude":' , str ( place_row . climate_place . latitude ) , '}' ) ) ) return ( '[%s]' % ',' . join ( stations_strings ) )
return all station data in json format - join the 4 tables assuming a common id to link records .