app/soc/views/models/program.py
changeset 647 355ac73823a1
parent 643 b57d538a9dd3
child 649 95a41542e693
equal deleted inserted replaced
646:860e17e5118f 647:355ac73823a1
   113       params: a dict with params for this View
   113       params: a dict with params for this View
   114     """
   114     """
   115 
   115 
   116     new_params = {}
   116     new_params = {}
   117     new_params['list_action'] = (redirects.getCreateProgramRedirect, params)
   117     new_params['list_action'] = (redirects.getCreateProgramRedirect, params)
   118     new_params['instruction_text'] = \
   118     new_params['list_description'] = \
   119         self.DEF_CREATE_INSTRUCTION_MSG_FMT % self._params
   119         self.DEF_CREATE_INSTRUCTION_MSG_FMT % self._params
   120 
   120 
       
   121     new_params = dicts.merge(new_params, sponsor_view.view._params)
   121     params = dicts.merge(new_params, params)
   122     params = dicts.merge(new_params, params)
   122     params = dicts.merge(params, sponsor_view.view._params)
       
   123 
   123 
   124     content = helper.lists.getListContent(request, params, sponsor_logic.logic)
   124     content = helper.lists.getListContent(request, params, sponsor_logic.logic)
   125     contents = [content]
   125     contents = [content]
   126 
   126 
   127     return self._list(request, params, contents, page_name)
   127     return self._list(request, params, contents, page_name)
   130     """See base.View._editGet().
   130     """See base.View._editGet().
   131     """
   131     """
   132 
   132 
   133     # fill in the email field with the data from the entity
   133     # fill in the email field with the data from the entity
   134     form.fields['scope_path'].initial = entity.scope_path
   134     form.fields['scope_path'].initial = entity.scope_path
       
   135 
       
   136   def _editPost(self, request, entity, fields):
       
   137     """See base.View._editPost().
       
   138     """
       
   139 
       
   140     sponsor = sponsor_logic.logic.getFromFields(link_id=fields['scope_path'])
       
   141     fields['scope'] = sponsor
       
   142 
   135 
   143 
   136   def getDjangoURLPatterns(self, params=None):
   144   def getDjangoURLPatterns(self, params=None):
   137     """See base.View.getDjangoURLPatterns().
   145     """See base.View.getDjangoURLPatterns().
   138     """
   146     """
   139 
   147