83 |
83 |
84 class View(base.View): |
84 class View(base.View): |
85 """View methods for the Document model. |
85 """View methods for the Document model. |
86 """ |
86 """ |
87 |
87 |
88 def __init__(self, original_params=None): |
88 def __init__(self, params=None): |
89 """Defines the fields and methods required for the base View class |
89 """Defines the fields and methods required for the base View class |
90 to provide the user with list, public, create, edit and delete views. |
90 to provide the user with list, public, create, edit and delete views. |
91 |
91 |
92 Params: |
92 Params: |
93 original_params: a dict with params for this View |
93 params: a dict with params for this View |
94 """ |
94 """ |
95 |
95 |
96 params = {} |
96 new_params = {} |
97 params['logic'] = soc.logic.models.document.logic |
97 new_params['logic'] = soc.logic.models.document.logic |
98 |
98 |
99 params['name'] = "Document" |
99 new_params['name'] = "Document" |
100 params['name_short'] = "Document" |
100 new_params['name_short'] = "Document" |
101 params['name_plural'] = "Documents" |
101 new_params['name_plural'] = "Documents" |
102 params['url_name'] = "document" |
102 new_params['url_name'] = "document" |
103 params['module_name'] = "document" |
103 new_params['module_name'] = "document" |
104 |
104 |
105 params['edit_form'] = EditForm |
105 new_params['edit_form'] = EditForm |
106 params['create_form'] = CreateForm |
106 new_params['create_form'] = CreateForm |
107 |
107 |
108 params = dicts.merge(original_params, params) |
108 params = dicts.merge(params, new_params) |
109 |
109 |
110 base.View.__init__(self, params=params) |
110 super(View, self).__init__(params=params) |
111 |
111 |
112 def _editPost(self, request, entity, fields): |
112 def _editPost(self, request, entity, fields): |
113 """See base.View._editPost(). |
113 """See base.View._editPost(). |
114 """ |
114 """ |
115 |
115 |