Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/', methods=['POST', 'GET'])
- def reports():
- form = ReportConfig()
- location = Cdr.query.with_entities(Cdr.src).distinct().limit(9).all()
- call_dict = {}
- numberofcalls = 0
- for x in location:
- total_calls = Cdr.query.filter_by(src=x.src).all()
- for y in total_calls:
- numberofcalls+=1
- call_dict[x.src] = numberofcalls
- print('The number of calls for ' + x.src, ':', numberofcalls)
- print(call_dict)
- return render_template('reports.html', title='Home', form=form, location=locations_, numofcalls= call_dict)
- <div class='col-4'>
- <div>
- <!-- I need the total number of calls here -->
- {% for num in numofcalls%}
- <p>{{numofcalls[num]}}</p>
- {% endfor %}
- </div>
- <div>
- <p>Test</p>
- </div>
- <div>
- <p>Test</p>
- </div>
- <div>
- <p>Average</p>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement