I finally used...
postcodelist=[]
closepostcodes=ukpostcodes.closest_postcodes(session.postcode,
str(session.distance))
for p in closepostcodes:
postcodelist.append(p[1])
rows = db(db.data.postcode.belongs==(p for p in
postcodelist)).select(db.data.download, db.data.postcode,
db.data.lat, db.data.lon,
db.providers.name,
left=db.providers.on(db.data.provider==db.providers.id),
orderby=~db.data.download)
Seems to work!
Thanks for the advice about the range generator. I'm still learning
all this stuff :-D
Chris
On Sun, Oct 2, 2011 at 7:38 AM, Chris Rowson
<[email protected]> wrote:
> Thanks Peter, I'll give that a try.
>
> Chris
>
> On Sep 30, 2011 8:01 PM, "Peter Etchells" <[email protected]>
> wrote:
>> results=db(db.data.belongs([p[1] for p in postcodes).select()
>