Mercurial > hg > GlobalNeighbors
comparison globalneighbors/web.py @ 14:27925261c137
fix broken tests including an aggregious case where we add ourselves as a neighbor to ourself
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 25 Jun 2017 14:29:18 -0700 |
parents | 94af113e498a |
children | 21095c9006e5 |
comparison
equal
deleted
inserted
replaced
13:94af113e498a | 14:27925261c137 |
---|---|
61 "geonameid": i['geonameid']}) | 61 "geonameid": i['geonameid']}) |
62 else: | 62 else: |
63 retval = [{"name": i[name], | 63 retval = [{"name": i[name], |
64 "geonameid": i['geonameid']} | 64 "geonameid": i['geonameid']} |
65 for i in cities] | 65 for i in cities] |
66 return sorted(retval)[:limit] | 66 return sorted(retval, key=lambda x: x['name'])[:limit] |
67 | 67 |
68 | 68 |
69 class Handler(object): | 69 class Handler(object): |
70 """base class for HTTP handler""" | 70 """base class for HTTP handler""" |
71 | 71 |