86 |
86 |
87 class View(base.View): |
87 class View(base.View): |
88 """View methods for the Docs model. |
88 """View methods for the Docs model. |
89 """ |
89 """ |
90 |
90 |
91 def __init__(self, original_params=None, original_rights=None): |
91 def __init__(self, original_params=None): |
92 """Defines the fields and methods required for the base View class |
92 """Defines the fields and methods required for the base View class |
93 to provide the user with list, public, create, edit and delete views. |
93 to provide the user with list, public, create, edit and delete views. |
94 |
94 |
95 Params: |
95 Params: |
96 original_params: a dict with params for this View |
96 original_params: a dict with params for this View |
97 original_rights: a dict with right definitions for this View |
|
98 """ |
97 """ |
99 |
98 |
100 self._logic = soc.logic.models.request.logic |
99 self._logic = soc.logic.models.request.logic |
101 |
100 |
102 params = {} |
101 params = {} |
103 rights = {} |
|
104 |
102 |
105 params['name'] = "Request" |
103 params['name'] = "Request" |
106 params['name_short'] = "Request" |
104 params['name_short'] = "Request" |
107 params['name_plural'] = "Requests" |
105 params['name_plural'] = "Requests" |
108 params['url_name'] = "request" |
106 params['url_name'] = "request" |
132 |
130 |
133 params['edit_params'] = { |
131 params['edit_params'] = { |
134 self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED, |
132 self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED, |
135 } |
133 } |
136 |
134 |
137 rights['list'] = [helper.access.checkIsDeveloper] |
135 params = dicts.merge(original_params, params) |
138 rights['delete'] = [helper.access.checkIsDeveloper] |
|
139 |
136 |
140 params = dicts.merge(original_params, params) |
137 base.View.__init__(self, params=params) |
141 rights = dicts.merge(original_rights, rights) |
|
142 |
|
143 base.View.__init__(self, rights=rights, params=params) |
|
144 |
138 |
145 def _editSeed(self, request, seed): |
139 def _editSeed(self, request, seed): |
146 """See base.View._editGet(). |
140 """See base.View._editGet(). |
147 """ |
141 """ |
148 |
142 |