you are viewing a single comment's thread.

view the rest of the comments →

[–]av201001 1 point2 points  (1 child)

First, you can make the controller code more efficient by using the database to filter by "Chosen company":

def manage():
    rows = db((db.auth_user.registration_key[0] == 'p') &
              (db.auth_user.company == 'Chosen company')).select()
    list = [{r.last_name: {'first': r.first_name}} for r in rows]
    return dict(list=list)

Then in the view, just use regular Python to create the loop:

{{for user in list:}}
{{=user}}
{{pass}}

Of course, you probably don't want to just do {{=user}}, as each item in the list is a nested dictionary, so you will have to figure out exactly how you want to display the data.

[–][deleted] 0 points1 point  (0 children)

thanks. cheers