diff --git a/ch03/web/index.py b/ch03/web/index.py index 26e3975..419f603 100644 --- a/ch03/web/index.py +++ b/ch03/web/index.py @@ -16,7 +16,7 @@ def sent_counts(): sent_counts = db['sent_counts'].find() results = {} results['keys'] = 'from', 'to', 'total' - results['values'] = [[s['from'], s['to'], s['total']] for s in sent_counts if re.search('apache', s['from']) or re.search('apache', s['to'])] + results['values'] = [[s['from'], s['to'], s['total']] for s in sent_counts if re.search('apache', str(s['from'])) or re.search('apache', str(s['to']))] results['values'] = results['values'][0:17] return render_template('table.html', results=results)