Dotted path to the views in URL patterns is changed to a params parameter.
This change makes the URL mapping from URL to View method in patterns generic
where the base package path is taken from the params['module_package'] value
to support module system of Melange where inherited View classes override the
params['module_package'] value to specify their own View methods.
--- a/app/soc/views/models/group.py Sat Aug 22 03:44:13 2009 +0530
+++ b/app/soc/views/models/group.py Sat Aug 22 03:56:04 2009 +0530
@@ -70,17 +70,17 @@
patterns += [
(r'^%(url_name)s/(?P<access_type>list_requests)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.list_requests',
+ '%(module_package)s.%(module_name)s.list_requests',
'List of requests for %(name)s'),
(r'^%(url_name)s/(?P<access_type>list_roles)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.list_roles',
+ '%(module_package)s.%(module_name)s.list_roles',
'List of roles for %(name)s')]
if params.get('group_applicant_url'):
# add the applicant pattern
patterns += [
(r'^%(url_name)s/(?P<access_type>applicant)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.applicant',
+ '%(module_package)s.%(module_name)s.applicant',
"%(name)s Creation via Accepted Application"),]
new_params['extra_django_patterns'] = patterns
--- a/app/soc/views/models/organization.py Sat Aug 22 03:44:13 2009 +0530
+++ b/app/soc/views/models/organization.py Sat Aug 22 03:56:04 2009 +0530
@@ -121,10 +121,10 @@
patterns += [
(r'^%(url_name)s/(?P<access_type>apply_mentor)/%(scope)s$',
- 'soc.views.models.%(module_name)s.apply_mentor',
+ '%(module_package)s.%(module_name)s.apply_mentor',
"List of all %(name_plural)s you can apply to"),
(r'^%(url_name)s/(?P<access_type>list_proposals)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.list_proposals',
+ '%(module_package)s.%(module_name)s.list_proposals',
"List of all Student Proposals for this %(name)s"),
]
--- a/app/soc/views/models/presence.py Sat Aug 22 03:44:13 2009 +0530
+++ b/app/soc/views/models/presence.py Sat Aug 22 03:56:04 2009 +0530
@@ -83,7 +83,7 @@
page_name = "Home"
patterns += [(r'^%(url_name)s/(?P<access_type>home)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.home',
+ '%(module_package)s.%(module_name)s.home',
page_name)]
new_params['extra_django_patterns'] = patterns
--- a/app/soc/views/models/program.py Sat Aug 22 03:44:13 2009 +0530
+++ b/app/soc/views/models/program.py Sat Aug 22 03:56:04 2009 +0530
@@ -122,22 +122,22 @@
patterns = []
patterns += [
(r'^%(url_name)s/(?P<access_type>assign_slots)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.assign_slots',
+ '%(module_package)s.%(module_name)s.assign_slots',
'Assign slots'),
(r'^%(url_name)s/(?P<access_type>slots)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.slots',
+ '%(module_package)s.%(module_name)s.slots',
'Assign slots (JSON)'),
(r'^%(url_name)s/(?P<access_type>show_duplicates)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.show_duplicates',
+ '%(module_package)s.%(module_name)s.show_duplicates',
'Show duplicate slot assignments'),
(r'^%(url_name)s/(?P<access_type>assigned_proposals)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.assigned_proposals',
+ '%(module_package)s.%(module_name)s.assigned_proposals',
"Assigned proposals for multiple organizations"),
(r'^%(url_name)s/(?P<access_type>accepted_orgs)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.accepted_orgs',
+ '%(module_package)s.%(module_name)s.accepted_orgs',
"List all accepted organizations"),
(r'^%(url_name)s/(?P<access_type>list_projects)/%(key_fields)s$',
- 'soc.views.models.%(module_name)s.list_projects',
+ '%(module_package)s.%(module_name)s.list_projects',
"List all student projects"),
]
--- a/app/soc/views/models/role.py Sat Aug 22 03:44:13 2009 +0530
+++ b/app/soc/views/models/role.py Sat Aug 22 03:56:04 2009 +0530
@@ -98,32 +98,32 @@
if params.get('allow_requests_and_invites'):
# add patterns concerning requests and invites
patterns += [(r'^%(url_name)s/(?P<access_type>invite)/%(scope)s$',
- 'soc.views.models.%(module_name)s.invite',
+ '%(module_package)s.%(module_name)s.invite',
'Create invite for %(name)s'),
(r'^%(url_name)s/(?P<access_type>accept_invite)/%(scope)s/%(lnp)s$',
- 'soc.views.models.%(module_name)s.accept_invite',
+ '%(module_package)s.%(module_name)s.accept_invite',
'Accept invite for %(name)s'),
(r'^%(url_name)s/(?P<access_type>process_request)/%(scope)s/%(lnp)s$',
- 'soc.views.models.%(module_name)s.process_request',
+ '%(module_package)s.%(module_name)s.process_request',
'Process request'),
(r'^%(url_name)s/(?P<access_type>request)/%(scope)s$',
- 'soc.views.models.%(module_name)s.role_request',
+ '%(module_package)s.%(module_name)s.role_request',
'Create a Request to become %(name)s')]
elif params.get('allow_invites'):
# add patterns concerning only invites
patterns += [(r'^%(url_name)s/(?P<access_type>invite)/%(scope)s$',
- 'soc.views.models.%(module_name)s.invite',
+ '%(module_package)s.%(module_name)s.invite',
'Create invite for %(name)s'),
(r'^%(url_name)s/(?P<access_type>accept_invite)/%(scope)s/%(lnp)s$',
- 'soc.views.models.%(module_name)s.accept_invite',
+ '%(module_package)s.%(module_name)s.accept_invite',
'Accept invite for %(name)s'),
(r'^%(url_name)s/(?P<access_type>process_request)/%(scope)s/%(lnp)s$',
- 'soc.views.models.%(module_name)s.process_request',
+ '%(module_package)s.%(module_name)s.process_request',
'Process request for %(name)s')]
# add manage pattern
patterns += [(r'^%(url_name)s/(?P<access_type>manage)/%(scope)s/%(lnp)s$',
- 'soc.views.models.%(module_name)s.manage',
+ '%(module_package)s.%(module_name)s.manage',
'Manage a %(name)s'),]
new_params['extra_django_patterns'] = patterns
--- a/app/soc/views/models/student.py Sat Aug 22 03:44:13 2009 +0530
+++ b/app/soc/views/models/student.py Sat Aug 22 03:56:04 2009 +0530
@@ -92,10 +92,10 @@
# add apply pattern
patterns = [(r'^%(url_name)s/(?P<access_type>apply)/%(scope)s$',
- 'soc.views.models.%(module_name)s.apply',
+ '%(module_package)s.%(module_name)s.apply',
'Become a %(name)s'),
(r'^%(url_name)s/(?P<access_type>list_projects)/%(scope)s$',
- 'soc.views.models.%(module_name)s.list_projects',
+ '%(module_package)s.%(module_name)s.list_projects',
'List of my Student Projects'),]
new_params['extra_django_patterns'] = patterns