コード例 #1
0
    student = gci_student_logic.getFromKeyName(kwargs['key_name'])
    if not student:
        return responses.terminateTask()

    # find ranking entity for the student and clear it
    filter = {'student': student}
    ranking = gci_student_ranking_logic.getForFields(filter=filter,
                                                     unique=True)
    ranking.points = 0
    ranking.tasks = []
    ranking.put()

    # get all the tasks that the student has completed
    filter = {
        'student': student,
        'status': 'Closed',
    }
    tasks = gci_task_logic.getForFields(filter=filter)

    for task in tasks:
        gci_student_ranking_logic.updateRanking(task)

    return responses.terminateTask()


clear = clearGCIRanking
recalculate = recalculateGCIRanking
recalculate_student = recalculateGCIStudentRanking
update = decorators.task(updateGCIRanking)
コード例 #2
0
ファイル: statistic.py プロジェクト: pombredanne/Melange-1
        minimal_rights = logic.ACCESS_TYPES.index(access_type)
        for item in logic.ACCESS_TYPES[minimal_rights:]:
            ref_logic = logic.helper.LOGICS_DICT[item]
            try:
                checker.checkHasActiveRole({}, ref_logic.logic)
                has_access = True
                break
            except Exception:
                pass

        return has_access


view = View()

csv_export = view_decorators.view(view.csvExport)
manage_statistics = view_decorators.view(view.manageStatistics)
update_stats = view_decorators.view(view.updateOrClearStats)
visualize = view_decorators.view(view.visualize)
get_json_response = view_decorators.view(view.getJsonResponse)
get_virtual_statistics = view_decorators.view(view.getVirtualStatistics)
get_available_statistics = view_decorators.view(view.getAvailableStatistics)
set_collect_task = view_decorators.view(view.setCollectTask)
public = view_decorators.view(view.public)
create = view_decorators.view(view.create)
delete = view_decorators.view(view.delete)
edit = view_decorators.view(view.edit)
list = view_decorators.view(view.list)
collect_task = task_decorators.task(view.collectTask)
コード例 #3
0
ファイル: ranking_update.py プロジェクト: SRabbelier/Melange
  if not student:
    return responses.terminateTask()

  # find ranking entity for the student and clear it
  filter = {
      'student': student
      }
  ranking = gci_student_ranking_logic.getForFields(filter=filter,
      unique=True)
  ranking.points = 0
  ranking.tasks = []
  ranking.put()

  # get all the tasks that the student has completed
  filter = {
      'student': student,
      'status': 'Closed',
      }
  tasks = gci_task_logic.getForFields(filter=filter)

  for task in tasks:
    gci_student_ranking_logic.updateRanking(task)

  return responses.terminateTask()


clear = clearGCIRanking
recalculate = recalculateGCIRanking
recalculate_student = recalculateGCIStudentRanking
update = decorators.task(updateGCIRanking)
コード例 #4
0
ファイル: gsoc_statistic.py プロジェクト: SRabbelier/Melange
    """

    new_params = {}

    new_params['url_name'] = 'gsoc/statistic'
    new_params['module_name'] = 'gsoc_statistic'
    new_params['program_logic'] = gsoc_program_logic

    params = dicts.merge(params, new_params)

    super(View, self).__init__(params=params)


view = View()

manage_statistics = view_decorators.view(view.manageStatistics)
csv_export = view_decorators.view(view.csvExport)
manage_statistics = view_decorators.view(view.manageStatistics)
update_stats = view_decorators.view(view.updateOrClearStats)
visualize = view_decorators.view(view.visualize)
get_json_response = view_decorators.view(view.getJsonResponse)
get_virtual_statistics = view_decorators.view(view.getVirtualStatistics)
get_available_statistics = view_decorators.view(view.getAvailableStatistics)
set_collect_task = view_decorators.view(view.setCollectTask)
public = view_decorators.view(view.public)
create = view_decorators.view(view.create)
delete = view_decorators.view(view.delete)
edit = view_decorators.view(view.edit)
list = view_decorators.view(view.list)
collect_task = task_decorators.task(view.collectTask)