Hi I'm writing a web2py application that starts with a UK postcode and then retrieves information for surrounding UK postcodes. I have tried two methods of doing this - both of which work fine when the surrounding search area is relatively small (i.e. when there are few extra postcodes).
Method 1: added db.t_properties.f_postcode.contains(result) to the database query, where *result *contains a list of postcodes. Method 2: Ran the database query without the *contains* condition, and subsequently ran rows.exclude(lambda row: row.f_postcode not in result) However, when the search area increased to more than a couple of hundred results, I got results from both errors. A bit of googling revealed that Method 1 is constrained by the maximum number of conditions that you can search on in SQLite. Method 2 failed with the following message: <type 'exceptions.RuntimeError'> maximum recursion depth exceeded in cmp Now, I'm pretty certain that I could fix the error by moving to MySQL or another db, but I think I may not be approaching the query in the "correct" / most efficient way. Does anyone have any suggestions of the best way to proceed? thanks Rob -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.