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('')
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('')
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))
def score_calculator(member): return compute_score(project, member)
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))