Made the /create/<scope> url conditional
The 'no_create_with_scope' parameter can be used to disable it.
Patch by: Sverre Rabbelier
--- a/app/soc/views/helper/params.py Fri Jan 30 22:00:01 2009 +0000
+++ b/app/soc/views/helper/params.py Fri Jan 30 22:00:23 2009 +0000
@@ -123,8 +123,6 @@
'soc.views.models.%(module_name)s.export', 'Export %(name_short)s'),
(r'^%(url_name)s/(?P<access_type>create)$',
'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'),
- (r'^%(url_name)s/(?P<access_type>create)/%(scope)s$',
- 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'),
(r'^%(url_name)s/(?P<access_type>delete)/%(key_fields)s$',
'soc.views.models.%(module_name)s.delete', 'Delete %(name_short)s'),
(r'^%(url_name)s/(?P<access_type>edit)/%(key_fields)s$',
@@ -135,6 +133,11 @@
'soc.views.models.%(module_name)s.pick', 'Pick %(name_short)s'),
]
+ if not params.get('no_create_with_scope'):
+ new_params['django_patterns_defaults'] += [
+ (r'^%(url_name)s/(?P<access_type>create)/%(scope)s$',
+ 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s')]
+
if not params.get('no_create_with_key_fields'):
new_params['django_patterns_defaults'] += [
(r'^%(url_name)s/(?P<access_type>create)/%(key_fields)s$',