Commit 7d19e0d1903f2842ebe04607c45ef1b8dd4ec2d0
- Diff rendering mode:
- inline
- side by side
fetch.py
(13 / 7)
  | |||
50 | 50 | collection = db['data'] | |
51 | 51 | y = 0 | |
52 | 52 | ret = {} | |
53 | keywords_dict = json.loads(request.args['data']) | ||
54 | keywords = json.loads(keywords_dict)['data'] | ||
53 | 55 | for i in collection.find(): | |
54 | try: | ||
55 | if request.args['data'] in i['nodes']: | ||
56 | del(i['_id']) | ||
57 | ret[y] = i | ||
58 | y = y + 1 | ||
59 | except: | ||
60 | pass | ||
56 | for keyword in keywords: | ||
57 | print keyword | ||
58 | try: | ||
59 | if keyword in i['nodes']: | ||
60 | del(i['_id']) | ||
61 | ret[y] = i | ||
62 | y = y + 1 | ||
63 | except: | ||
64 | pass | ||
61 | 65 | return render_template('blank.html', content = ret) | |
66 | |||
67 | |||
62 | 68 | @app.route('/submit', methods=['POST']) | |
63 | 69 | def submit(): | |
64 | 70 | c = pymongo.Connection() |