<ul> {{for row in distinct_loc:}} <li class="list-group-item">*{{=row.*mydiary.Location}}<span class="badge pull-right">*{{=row[*sum_of_entries*]}}*</span></li> {{pass}} </ul>
On Sunday, 15 February 2015 23:32:11 UTC-6, Moiz Nagpurwala wrote: > > How to display the results of this query > > > in my controller i have this query: > > > def location(): > sum_of_entries = db.mydiary.id.count() > distinct_loc = db(db.mydiary.id > 0).select(sum_of_entries, db.mydiary > .Location, groupby=db.mydiary.Location) > # distinct_loc = db(db.mydiary.id > 0).select(db.mydiary.Location, > distinct=True) > return locals() > > I want to display each record in below format: > > <ul> > <li class="list-group-item">*Location*<span class="badge pull-right"> > *Count*</span></li> > </ul> > > > Please help. > > > -- 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.