Browse Source

fixing SQL query

joel
Simon Bowie 2 years ago
parent
commit
261ecbc7aa
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      web/app/tool.py

+ 1
- 1
web/app/tool.py View File

tools = Resource.query.filter_by(type='tool') tools = Resource.query.filter_by(type='tool')
for key in request.args.keys(): for key in request.args.keys():
if key == 'practice': if key == 'practice':
query = 'SELECT * FROM Resource LEFT JOIN Relationship ON Resource.id=Relationship.first_resource_id WHERE Relationship.second_resource_id=' + request.args.get(key) + ';'
query = 'SELECT Resource.* FROM Resource LEFT JOIN Relationship ON Resource.id=Relationship.first_resource_id WHERE Relationship.second_resource_id=' + request.args.get(key) + ';'
tools = db.engine.execute(query) tools = db.engine.execute(query)
else: else:
kwargs = {'type': 'tool', key: request.args.get(key)} kwargs = {'type': 'tool', key: request.args.get(key)}

Loading…
Cancel
Save