コード例 #1
0
def member_add(request):
  # get member info from session
  idem_member = Member()
  project = Project.objects.get(pk = request.GET['project_id'])
  all_members = request.session['members_' + str(project.id)]
  for member in all_members:
    if member.linkedin_url == request.GET['url']:
      # add member to database
      idem_member.proj = project
      idem_member.linkedin_url = member.linkedin_url
      idem_member.first_name = member.first_name
      idem_member.last_name = member.last_name
      idem_member.pic = member.pic
      idem_member.info = member.info
      update_skills_for_member(project, idem_member)
      idem_member.save()
      break

  # update project score
  score = compute_score(project)
  project.score = score
  project.nr_members = project.nr_members + 1
  project.save()
  return HttpResponse('')
コード例 #2
0
def member_add(request):
    # get member info from session
    idem_member = Member()
    project = Project.objects.get(pk=request.GET['project_id'])
    all_members = request.session['members_' + str(project.id)]
    for member in all_members:
        if member.linkedin_url == request.GET['url']:
            # add member to database
            idem_member.proj = project
            idem_member.linkedin_url = member.linkedin_url
            idem_member.first_name = member.first_name
            idem_member.last_name = member.last_name
            idem_member.pic = member.pic
            idem_member.info = member.info
            update_skills_for_member(project, idem_member)
            idem_member.save()
            break

    # update project score
    score = compute_score(project)
    project.score = score
    project.nr_members = project.nr_members + 1
    project.save()
    return HttpResponse('')
コード例 #3
0
def ajax_score(request):
  project = Project.objects.get(pk=request.GET['project_id'])
  score = compute_score(project)*100
  return render_to_response('ajax/score.html', {'score' : score}, RequestContext(request))
コード例 #4
0
 def score_calculator(member):
   return compute_score(project, member)
コード例 #5
0
def ajax_score(request):
    project = Project.objects.get(pk=request.GET['project_id'])
    score = compute_score(project) * 100
    return render_to_response('ajax/score.html', {'score': score},
                              RequestContext(request))
コード例 #6
0
 def score_calculator(member):
     return compute_score(project, member)