# HG changeset patch # User Sverre Rabbelier <srabbelier@gmail.com> # Date 1233352823 0 # Node ID 05ac761edb275f2e2e02daeacb9edfe530d5dd4d # Parent b03895bba47afdcc6331278302c22e95e88f9c39 Made the /create/<scope> url conditional The 'no_create_with_scope' parameter can be used to disable it. Patch by: Sverre Rabbelier diff -r b03895bba47a -r 05ac761edb27 app/soc/views/helper/params.py --- 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$',