app/soc/views/models/org_app.py
changeset 1645 c7e05dafaede
parent 1615 81f26c9809dc
child 1726 711c8dcab67e
equal deleted inserted replaced
1644:64ccd9628f15 1645:c7e05dafaede
    40 from soc.views.helper import redirects
    40 from soc.views.helper import redirects
    41 from soc.views.helper import responses
    41 from soc.views.helper import responses
    42 from soc.views.helper import widgets
    42 from soc.views.helper import widgets
    43 from soc.views.models import group_app
    43 from soc.views.models import group_app
    44 from soc.views.models import program as program_view
    44 from soc.views.models import program as program_view
    45 
       
    46 import soc.logic.dicts
       
    47 
    45 
    48 
    46 
    49 class View(group_app.View):
    47 class View(group_app.View):
    50   """View methods for the Organization Application model.
    48   """View methods for the Organization Application model.
    51   """
    49   """
   138     super(View, self).__init__(params=params)
   136     super(View, self).__init__(params=params)
   139 
   137 
   140   @ decorators.merge_params
   138   @ decorators.merge_params
   141   def reviewOverview(self, request, access_type,
   139   def reviewOverview(self, request, access_type,
   142                page_name=None, params=None, **kwargs):
   140                page_name=None, params=None, **kwargs):
       
   141     """View that allows to see organization application review overview.
       
   142 
       
   143        For Args see base.View.public().
       
   144     """
   143 
   145 
   144     params['list_template'] = 'soc/org_app/review_overview.html'
   146     params['list_template'] = 'soc/org_app/review_overview.html'
   145     context = {
   147     context = {
   146         'bulk_accept_link': '/org_app/bulk_accept/%(scope_path)s' %(kwargs),
   148         'bulk_accept_link': '/org_app/bulk_accept/%(scope_path)s' % (kwargs),
   147         'bulk_reject_link': '/org_app/bulk_reject/%(scope_path)s' %(kwargs),}
   149         'bulk_reject_link': '/org_app/bulk_reject/%(scope_path)s' % (kwargs),}
   148 
   150 
   149     return super(View, self).reviewOverview(request, access_type,
   151     return super(View, self).reviewOverview(request, access_type,
   150         page_name=page_name, params=params, context=context, **kwargs)
   152         page_name=page_name, params=params, context=context, **kwargs)
   151 
   153 
   152   def _editContext(self, request, context):
   154   def _editContext(self, request, context):
   254     """
   256     """
   255 
   257 
   256     # get the program entity from the keyname
   258     # get the program entity from the keyname
   257     program_entity = program_logic.logic.getFromKeyName(program_keyname)
   259     program_entity = program_logic.logic.getFromKeyName(program_keyname)
   258 
   260 
   259     # get all the organization applications for the given program and from_status
   261     # get all the organization applications for the 
       
   262     # given program and from_status
   260     filter = {'scope': program_entity,
   263     filter = {'scope': program_entity,
   261               'status': from_status}
   264               'status': from_status}
   262 
   265 
   263     org_app_entities = params['logic'].getForFields(filter=filter)
   266     org_app_entities = params['logic'].getForFields(filter=filter)
   264 
   267