Hello,

what would be the easiest way to find out how many items there is in a table grouped by a field.

I have a table where tickets are stored. Every ticket has an status, he number of statuses can change (only a reference to the t_status table). How do I find out how many tickets there is of every status?

Is this the easiest?

number_of_tickets= {}
for status in db(db.t_status).select()
number_of_tickets[status.id] = len(db(db.t_ticket.f_status == status.id).select()))

Kenneth

Reply via email to