107 new_params['django_patterns_defaults'] = [ |
107 new_params['django_patterns_defaults'] = [ |
108 (r'^%(url_name)s/(?P<access_type>show)/%(key_fields)s$', |
108 (r'^%(url_name)s/(?P<access_type>show)/%(key_fields)s$', |
109 'soc.views.models.%(module_name)s.public', 'Show %(name_short)s'), |
109 'soc.views.models.%(module_name)s.public', 'Show %(name_short)s'), |
110 (r'^%(url_name)s/(?P<access_type>create)$', |
110 (r'^%(url_name)s/(?P<access_type>create)$', |
111 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'), |
111 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'), |
112 (r'^%(url_name)s/(?P<access_type>create)/%(key_fields)s$', |
|
113 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'), |
|
114 (r'^%(url_name)s/(?P<access_type>create)/%(scope)s$', |
112 (r'^%(url_name)s/(?P<access_type>create)/%(scope)s$', |
115 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'), |
113 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'), |
116 (r'^%(url_name)s/(?P<access_type>delete)/%(key_fields)s$', |
114 (r'^%(url_name)s/(?P<access_type>delete)/%(key_fields)s$', |
117 'soc.views.models.%(module_name)s.delete', 'Delete %(name_short)s'), |
115 'soc.views.models.%(module_name)s.delete', 'Delete %(name_short)s'), |
118 (r'^%(url_name)s/(?P<access_type>edit)/%(key_fields)s$', |
116 (r'^%(url_name)s/(?P<access_type>edit)/%(key_fields)s$', |
119 'soc.views.models.%(module_name)s.edit', 'Edit %(name_short)s'), |
117 'soc.views.models.%(module_name)s.edit', 'Edit %(name_short)s'), |
120 (r'^%(url_name)s/(?P<access_type>list)$', |
118 (r'^%(url_name)s/(?P<access_type>list)$', |
121 'soc.views.models.%(module_name)s.list', 'List %(name_plural)s'), |
119 'soc.views.models.%(module_name)s.list', 'List %(name_plural)s'), |
122 ] |
120 ] |
123 |
121 |
|
122 if not params.get('no_create_with_key_fields'): |
|
123 new_params['django_patterns_defaults'] += [ |
|
124 (r'^%(url_name)s/(?P<access_type>create)/%(key_fields)s$', |
|
125 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s')] |
|
126 |
124 new_params['public_template'] = 'soc/%(module_name)s/public.html' % params |
127 new_params['public_template'] = 'soc/%(module_name)s/public.html' % params |
125 new_params['create_template'] = 'soc/models/edit.html' |
128 new_params['create_template'] = 'soc/models/edit.html' |
126 new_params['edit_template'] = 'soc/models/edit.html' |
129 new_params['edit_template'] = 'soc/models/edit.html' |
127 new_params['list_template'] = 'soc/models/list.html' |
130 new_params['list_template'] = 'soc/models/list.html' |
128 new_params['invite_template'] = 'soc/models/invite.html' |
131 new_params['invite_template'] = 'soc/models/invite.html' |