# HG changeset patch # User Sverre Rabbelier # Date 1239058527 0 # Node ID 2131c4b05ca3c39602c7eef346ec8778006b56ec # Parent eb92d9a6b0275aee26fd868610f25fac0d097504 Use the new nr_applications and nr_mentors This saves _a lot_ of computing time, making it possible to use the slot allocation view when there are a significant number of orgs. Patch by: Sverre Rabbelier diff -r eb92d9a6b027 -r 2131c4b05ca3 app/soc/views/models/program.py --- a/app/soc/views/models/program.py Mon Apr 06 22:55:08 2009 +0000 +++ b/app/soc/views/models/program.py Mon Apr 06 22:55:27 2009 +0000 @@ -292,15 +292,9 @@ mentors = {} for org in organizations: - filter = { - 'org': org, - 'status': ['new', 'pending'] - } orgs[org.link_id] = org - query = student_proposal_logic.logic.getQueryForFields(filter=filter) - proposals = student_proposal_logic.logic.getAll(query) - applications[org.link_id] = len(proposals) - mentors[org.link_id] = len([i for i in proposals if i.mentor != None]) + applications[org.link_id] = org.nr_applications + mentors[org.link_id] = org.nr_mentors # TODO: Use configuration variables here max_slots_per_org = 40