app/soc/views/models/document.py
changeset 507 3603fdafabf7
parent 502 e1e24c0a4e82
child 512 aae25d2b4464
equal deleted inserted replaced
506:deaf548efde3 507:3603fdafabf7
    80 
    80 
    81 class View(base.View):
    81 class View(base.View):
    82   """View methods for the Document model.
    82   """View methods for the Document model.
    83   """
    83   """
    84 
    84 
    85   def __init__(self, original_params=None, original_rights=None):
    85   def __init__(self, original_params=None):
    86     """Defines the fields and methods required for the base View class
    86     """Defines the fields and methods required for the base View class
    87     to provide the user with list, public, create, edit and delete views.
    87     to provide the user with list, public, create, edit and delete views.
    88 
    88 
    89     Params:
    89     Params:
    90       original_params: a dict with params for this View
    90       original_params: a dict with params for this View
    91       original_rights: a dict with right definitions for this View
       
    92     """
    91     """
    93 
    92 
    94     self._logic = soc.logic.models.document.logic
    93     self._logic = soc.logic.models.document.logic
    95 
    94 
    96     params = {}
    95     params = {}
    97     rights = {}
       
    98 
    96 
    99     params['name'] = "Document"
    97     params['name'] = "Document"
   100     params['name_short'] = "Document"
    98     params['name_short'] = "Document"
   101     params['name_plural'] = "Documents"
    99     params['name_plural'] = "Documents"
   102     params['url_name'] = "document"
   100     params['url_name'] = "document"
   123 
   121 
   124     params['edit_params'] = {
   122     params['edit_params'] = {
   125         self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
   123         self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
   126         }
   124         }
   127 
   125 
   128     rights['list'] = [helper.access.checkIsDeveloper]
   126     params = dicts.merge(original_params, params)
   129     rights['delete'] = [helper.access.checkIsDeveloper]
       
   130 
   127 
   131     params = dicts.merge(original_params, params)
   128     base.View.__init__(self, params=params)
   132     rights = dicts.merge(original_rights, rights)
       
   133 
       
   134     base.View.__init__(self, rights=rights, params=params)
       
   135 
   129 
   136   def _editPost(self, request, entity, fields):
   130   def _editPost(self, request, entity, fields):
   137     """See base.View._editPost().
   131     """See base.View._editPost().
   138     """
   132     """
   139 
   133