Renamed role_names to role_logic and made it a dictionary.
It now maps a role_name to role_logic. This will be useful for listing for instance club members.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/views/models/club.py Sun Jan 25 21:52:35 2009 +0000
+++ b/app/soc/views/models/club.py Sun Jan 25 22:05:25 2009 +0000
@@ -42,6 +42,8 @@
from soc.views.models import group
import soc.logic.models.club
+import soc.logic.models.club_admin
+import soc.logic.models.club_member
import soc.views.helper
@@ -84,8 +86,10 @@
required=False),
}
- # set the role names for the request overview
- new_params['role_names'] = ['club_admin', 'club_member']
+ # set the roles logic
+ new_params['roles_logic'] = {
+ 'club_admin': soc.logic.models.club_admin.logic,
+ 'club_member': soc.logic.models.club_admin.logic}
params = dicts.merge(params, new_params)
--- a/app/soc/views/models/group.py Sun Jan 25 21:52:35 2009 +0000
+++ b/app/soc/views/models/group.py Sun Jan 25 22:05:25 2009 +0000
@@ -124,7 +124,7 @@
# set the pagename to include the link_id
page_name = '%s %s' %(page_name, kwargs['link_id'])
- role_names = params['role_names']
+ role_names = params['roles_logic'].keys()
# list all incoming requests
filter = {
--- a/app/soc/views/models/sponsor.py Sun Jan 25 21:52:35 2009 +0000
+++ b/app/soc/views/models/sponsor.py Sun Jan 25 22:05:25 2009 +0000
@@ -28,8 +28,9 @@
from soc.views.models import group
import soc.models.sponsor
+import soc.logic.dicts
+import soc.logic.models.host
import soc.logic.models.sponsor
-import soc.logic.dicts
class View(group.View):
@@ -52,8 +53,8 @@
new_params['name'] = "Program Owner"
new_params['module_name'] = "sponsor"
- # set the role names for the request overview
- new_params['role_names'] = ['host']
+ # set the roles logic
+ new_params['roles_logic'] = {'host': soc.logic.models.host.logic}
params = dicts.merge(params, new_params)