Пример #1
0
    def getListData(self):
        """Returns the list data as requested by the current request.

    If the lists as requested is not supported by this component None is
    returned.
    """
        idx = lists.getListIndex(self.data.request)
        if idx == 0:
            list_query = project_logic.getProjectsQuery(
                program=self.data.program)

            starter = lists.keyStarter
            # TODO(daniel): support prefetching of NDB organizations
            #prefetcher = lists.ModelPrefetcher(
            #    project_model.GSoCProject, ['org'], parent=True)
            prefetcher = None

            response_builder = lists.RawQueryContentResponseBuilder(
                self.data.request,
                self._list_config,
                list_query,
                starter,
                prefetcher=prefetcher)
            return response_builder.build()
        else:
            return None
Пример #2
0
 def context(self, data, check, mutator):
   list_query = project_logic.getProjectsQuery(program=data.program)
   return {
     'page_name': 'Projects list page',
     'list': projects_list.ProjectList(data, list_query, idx=self.LIST_IDX,
         row_action=_getManageProjectRowAction),
   }
Пример #3
0
 def jsonContext(self, data, check, mutator):
     list_query = project_logic.getProjectsQuery(program=data.program)
     list_content = projects_list.ProjectList(data, list_query, idx=self.LIST_IDX).getListData()
     if list_content:
         return list_content.content()
     else:
         raise exception.Forbidden(message="You do not have access to this data")
Пример #4
0
 def context(self, data, check, mutator):
     list_query = project_logic.getProjectsQuery(program=data.program)
     return {
         'page_name': 'Projects list page',
         'list': projects_list.ProjectList(data,
                                           list_query,
                                           idx=self.LIST_IDX),
     }
Пример #5
0
 def jsonContext(self, data, check, mutator):
     list_query = project_logic.getProjectsQuery(program=data.program)
     list_content = projects_list.ProjectList(
         data, list_query, idx=self.LIST_IDX).getListData()
     if list_content:
         return list_content.content()
     else:
         raise exception.Forbidden(
             message='You do not have access to this data')
Пример #6
0
    def getListData(self):
        """Returns the list data as requested by the current request.

    If the lists as requested is not supported by this component None is
    returned.
    """
        idx = lists.getListIndex(self.request)
        if idx == 0:
            list_query = project_logic.getProjectsQuery(program=self.data.program)

            starter = lists.keyStarter
            prefetcher = lists.modelPrefetcher(GSoCProject, ["org"], parent=True)

            response_builder = lists.RawQueryContentResponseBuilder(
                self.request, self._list_config, list_query, starter, prefetcher=prefetcher
            )
            return response_builder.build()
        else:
            return None
  def getListData(self):
    """Returns the list data as requested by the current request.

    If the lists as requested is not supported by this component None is
    returned.
    """
    idx = lists.getListIndex(self.data.request)
    if idx == 0:
      list_query = project_logic.getProjectsQuery(program=self.data.program)

      starter = lists.keyStarter
      # TODO(daniel): support prefetching of NDB organizations
      #prefetcher = lists.ModelPrefetcher(
      #    project_model.GSoCProject, ['org'], parent=True)
      prefetcher = None

      response_builder = lists.RawQueryContentResponseBuilder(
          self.data.request, self._list_config, list_query,
          starter, prefetcher=prefetcher)
      return response_builder.build()
    else:
      return None
Пример #8
0
 def context(self, data, check, mutator):
     list_query = project_logic.getProjectsQuery(program=data.program)
     return {
         "page_name": "Projects list page",
         "list": projects_list.ProjectList(data, list_query, idx=self.LIST_IDX),
     }