74 new_params['name'] = "Document" |
74 new_params['name'] = "Document" |
75 |
75 |
76 new_params['export_content_type'] = 'text/text' |
76 new_params['export_content_type'] = 'text/text' |
77 |
77 |
78 names = [i for i in document_logic.getKeyFieldNames() if i != 'link_id'] |
78 names = [i for i in document_logic.getKeyFieldNames() if i != 'link_id'] |
79 create_pattern = params_helper.getPattern(names, linkable.SCOPE_PATH_ARG_PATTERN) |
79 create_pattern = params_helper.getPattern( |
|
80 names, linkable.SCOPE_PATH_ARG_PATTERN) |
80 |
81 |
81 new_params['extra_django_patterns'] = [ |
82 new_params['extra_django_patterns'] = [ |
82 (r'^document/(?P<access_type>create)/%s$' % create_pattern, |
83 (r'^document/(?P<access_type>create)/%s$' % create_pattern, |
83 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s')] |
84 'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'), |
|
85 (r'^document/(?P<access_type>list)/%s$' % create_pattern, |
|
86 'soc.views.models.%(module_name)s.list', 'List %(name_plural)s') |
|
87 ] |
84 |
88 |
85 new_params['no_create_with_scope'] = True |
89 new_params['no_create_with_scope'] = True |
86 new_params['no_create_with_key_fields'] = True |
90 new_params['no_create_with_key_fields'] = True |
87 |
91 |
88 new_params['create_extra_dynafields'] = { |
92 new_params['create_extra_dynafields'] = { |
109 } |
113 } |
110 |
114 |
111 params = dicts.merge(params, new_params) |
115 params = dicts.merge(params, new_params) |
112 |
116 |
113 super(View, self).__init__(params=params) |
117 super(View, self).__init__(params=params) |
|
118 |
|
119 def list(self, request, access_type, page_name=None, |
|
120 params=None, filter=None, **kwargs): |
|
121 """See base.View.list. |
|
122 """ |
|
123 |
|
124 return super(View, self).list(request, access_type, page_name=page_name, |
|
125 params=params, filter=kwargs) |
114 |
126 |
115 def _editPost(self, request, entity, fields): |
127 def _editPost(self, request, entity, fields): |
116 """See base.View._editPost(). |
128 """See base.View._editPost(). |
117 """ |
129 """ |
118 |
130 |