On Saturday, October 8, 2011 11:50:17 PM UTC-4, IK wrote:
>
> I tried your suggestion, but it would still throw the same error.
>
> so:
>
> {for item in items:}} ### item in controller is changed to items
> Listing {{=item.title}} max price
>
>
> {{prices=db(db.price.listing==item.id).select(orderby=db.price.weekly,distinct=True)}}
>
>
> {{=prices.last().weekly}}
>
>
> <type 'exceptions.AttributeError'>('NoneType' object has no attribute
> 'weekly')
>
Is it possible that some items don't have any prices, so the query isn't
returning any rows for those items? In that case, you'd first want to test
to make a result was returned.