[web2py] Re: Displaying for loop results only once

2020-01-23 Thread mostwanted
Thanks alot Tim, this is all i did: {{for bookings in bookings:}} *Quoted* {{pass}} The red line above replaced alot of clearly unnecessary code! Regards; Mostwanted On Tuesday, January 21, 2020 at 2:26:35 PM UTC+2, Tim Nyborg wrote: > > Simplest fix: use "any" instead: > > {{for bookings

[web2py] Re: Displaying for loop results only once

2020-01-21 Thread Tim Nyborg
Simplest fix: use "any" instead: {{for bookings in bookings:}} {{if any(bookings.company in q.customer.company for q in quotes):}} Quoted {{pass}} {{pass}} To avoid all this looping, you could have a separate query join the two tables and count the matches. On Saturday, 18 January