209 return self.editPost(request, entity, context, params) |
209 return self.editPost(request, entity, context, params) |
210 else: |
210 else: |
211 return self.editGet(request, entity, context, seed, params) |
211 return self.editGet(request, entity, context, seed, params) |
212 |
212 |
213 def editPost(self, request, entity, context, params): |
213 def editPost(self, request, entity, context, params): |
214 """Processes POST requests for the specified entity |
214 """Processes POST requests for the specified entity. |
215 |
215 |
216 Params usage: |
216 Params usage: |
217 The params dictionary is passed to _constructResponse when the |
217 The params dictionary is passed to _constructResponse when the |
218 form is not valid (see edit_form and create_form below). See |
218 form is not valid (see edit_form and create_form below). See |
219 the docstring of _constructResponse on how it uses it. |
219 the docstring of _constructResponse on how it uses it. |
271 return helper.responses.redirectToChangedSuffix( |
271 return helper.responses.redirectToChangedSuffix( |
272 request, None, new_suffix, |
272 request, None, new_suffix, |
273 params=page_params) |
273 params=page_params) |
274 |
274 |
275 def editGet(self, request, entity, context, seed, params): |
275 def editGet(self, request, entity, context, seed, params): |
276 """Processes GET requests for the specified entity |
276 """Processes GET requests for the specified entity. |
277 |
277 |
278 Params usage: |
278 Params usage: |
279 The params dictionary is passed to _constructResponse, see the |
279 The params dictionary is passed to _constructResponse, see the |
280 docstring of _constructResponse on how it uses it. |
280 docstring of _constructResponse on how it uses it. |
281 |
281 |
282 save_message: The save_message list is used as argument to |
282 save_message: The save_message list is used as argument to |
283 getSingleIndexedParamValue when an existing entity was saved. |
283 getSingleIndexedParamValue when an existing entity was saved. |
284 edit_form: The edit_form is used as form if there is an existing |
284 edit_form: The edit_form is used as form if there is an existing |
285 entity. The existing entity is passed as instance to it on |
285 entity. The existing entity is passed as instance to it on |
344 params: a dict with params for this View |
344 params: a dict with params for this View |
345 filter: a dict for the properties that the entities should have |
345 filter: a dict for the properties that the entities should have |
346 |
346 |
347 Params usage: |
347 Params usage: |
348 The params dictionary is passed as argument to getListContent in |
348 The params dictionary is passed as argument to getListContent in |
349 the soc.views.helper.list module. See the docstring for |
349 the soc.views.helper.list module. See the docstring for getListContent |
350 getListContent on how it uses it. |
350 on how it uses it. The params dictionary is also passed as argument to |
351 The params dictionary is also passed as argument to the _list |
351 the _list method. See the docstring for _list on how it uses it. |
352 method. See the docstring for _list on how it uses it. |
|
353 |
352 |
354 rights: The rights dictionary is used to check if the user has |
353 rights: The rights dictionary is used to check if the user has |
355 the required rights to list all entities of this View's type. |
354 the required rights to list all entities of this View's type. |
356 See checkAccess for more details on how the rights dictionary |
355 See checkAccess for more details on how the rights dictionary |
357 is used to check access rights. |
356 is used to check access rights. |
368 contents = [content] |
367 contents = [content] |
369 |
368 |
370 return self._list(request, params, contents, page_name) |
369 return self._list(request, params, contents, page_name) |
371 |
370 |
372 def _list(self, request, params, contents, page_name): |
371 def _list(self, request, params, contents, page_name): |
373 """Returns the list page for the specified contents |
372 """Returns the list page for the specified contents. |
374 |
373 |
375 Args: |
374 Args: |
376 request: the standard Django HTTP request object |
375 request: the standard Django HTTP request object |
377 params: a dict with params for this View |
376 params: a dict with params for this View |
378 contents: a list of content dicts |
377 contents: a list of content dicts |
408 params: a dict with params for this View |
407 params: a dict with params for this View |
409 kwargs: The Key Fields for the specified entity |
408 kwargs: The Key Fields for the specified entity |
410 |
409 |
411 Params usage: |
410 Params usage: |
412 rights: The rights dictionary is used to check if the user has |
411 rights: The rights dictionary is used to check if the user has |
413 the required rights to delete the specified entity. |
412 the required rights to delete the specified entity. See checkAccess |
414 See checkAccess for more details on how the rights dictionary |
413 for more details on how the rights dictionary is used to check access |
415 is used to check access rights. |
414 rights. |
416 name: used in the same way as in edit(), see it's docstring for |
415 name: used in the same way as in edit(), see it's docstring for |
417 a more detailed explanation on how it is used. |
416 a more detailed explanation on how it is used. |
418 missing_redirect: see name |
417 missing_redirect: see name |
419 error_edit: see name |
418 error_edit: see name |
420 delete_redirect: The delete_redirect value is used as the url to |
419 delete_redirect: The delete_redirect value is used as the url to |
462 def _editPost(self, request, entity, fields): |
461 def _editPost(self, request, entity, fields): |
463 """Performs any required processing on the entity to post its edit page. |
462 """Performs any required processing on the entity to post its edit page. |
464 |
463 |
465 Args: |
464 Args: |
466 request: the django request object |
465 request: the django request object |
467 entity: the entity to create or update from POST contents |
466 entity: the entity to create or update from POST contents |
468 fields: the new field values |
467 fields: the new field values |
469 """ |
468 """ |
470 |
469 |
471 pass |
470 pass |
472 |
471 |
549 request: the django request object |
548 request: the django request object |
550 params: a dict with params for this View |
549 params: a dict with params for this View |
551 |
550 |
552 Params usage: |
551 Params usage: |
553 The params dictionary is passed as argument to getSidebarItems |
552 The params dictionary is passed as argument to getSidebarItems |
554 from the soc.views.sitemap.sidebar module, see the docstring |
553 from the soc.views.sitemap.sidebar module, see the docstring |
555 of _getSidebarItems on how it uses it. |
554 of _getSidebarItems on how it uses it. |
556 """ |
555 """ |
557 |
556 |
558 params = dicts.merge(params, self._params) |
557 params = dicts.merge(params, self._params) |
559 return sitemap.sidebar.getSidebarLinks(request, params) |
558 return sitemap.sidebar.getSidebarLinks(request, params) |
560 |
559 |
561 def getDjangoURLPatterns(self, params=None): |
560 def getDjangoURLPatterns(self, params=None): |
562 """Retrieves a list of sidebar entries for this view |
561 """Retrieves a list of sidebar entries for this view |
563 |
562 |
564 Params usage: |
563 Params usage: |
565 The params dictionary is passed to the getDjangoURLPatterns |
564 The params dictionary is passed to the getDjangoURLPatterns |
566 function in the soc.views.sitemap.sitemap module, see the |
565 function in the soc.views.sitemap.sitemap module, see the |
567 docstring of getDjangoURLPatterns on how it uses it. |
566 docstring of getDjangoURLPatterns on how it uses it. |
568 |
567 |
569 Args: |
568 Args: |
570 params: a dict with params for this View |
569 params: a dict with params for this View |
571 """ |
570 """ |
572 |
571 |