Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	interactive_map/volume_api/get_volume_link_api.py
  • Loading branch information
radumas committed Oct 5, 2017
2 parents b60827b + 148ef3c commit 3fd2836
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions interactive_map/volume_api/get_volume_link_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@


CONFIG = configparser.ConfigParser()
CONFIG.read('hug.cfg')
CONFIG.read('db.cfg')
dbsettings = CONFIG['DBSETTINGS']

sql = pgsql.SQL('SELECT hh, volume FROM prj_volume.centreline_hourly_group12 WHERE year = {year} AND centreline_id = {centreline_id}')
sql = pgsql.SQL('SELECT * FROM prj_volume.centreline_hourly_group12 WHERE year = {year} AND centreline_id = {centreline_id}')

def cors_support(response, *args, **kwargs):
response.set_header('Access-Control-Allow-Origin', '*')
Expand All @@ -26,10 +26,5 @@ def get_volume_year_link(year: hug.types.number, centreline_id: hug.types.number
centreline_id=pgsql.Literal(centreline_id)))
data = cur.fetchall()
con.close()
data_dict = {'hh': [], 'volume': []}
for row in data:
data_dict['hh'].append(row['hh'])
data_dict['volume'].append(row['volume'])
return data_dict


return data

0 comments on commit 3fd2836

Please sign in to comment.