示例#1
0
def installations(installations):
    data = {
        'total': installations.count(),
        'installation_for_software': count_by(installations, lambda inst: inst.software.name),
        'installation_for_hardware': count_by(installations, lambda inst: inst.hardware.type),
        'installation_for_installer': count_by(installations, lambda inst: inst.installer.collaborator.user.username)
    }
    return data
示例#2
0
def talks(talks):
    data = {
        'total': talks.count(),
        'talks_for_room': count_by(talks, lambda talk: talk.room.name),
        'talks_for_type': count_by(talks, lambda talk: talk.talk_proposal.type.name),
        'talks_for_level': count_by(talks, lambda talk: talk.talk_proposal.level)
    }
    return data
示例#3
0
文件: reduces.py 项目: jemora/eventoL
def talks(talks):
    data = {
        'total':
        talks.count(),
        'talks_for_room':
        count_by(talks, lambda talk: talk.room.name),
        'talks_for_type':
        count_by(talks, lambda talk: talk.talk_proposal.type.name),
        'talks_for_level':
        count_by(talks, lambda talk: talk.talk_proposal.level)
    }
    return data
示例#4
0
文件: reduces.py 项目: jemora/eventoL
def installations(installations):
    data = {
        'total':
        installations.count(),
        'installation_for_software':
        count_by(installations, lambda inst: inst.software.name),
        'installation_for_hardware':
        count_by(installations, lambda inst: inst.hardware.type),
        'installation_for_installer':
        count_by(installations,
                 lambda inst: inst.installer.collaborator.user.username)
    }
    return data
示例#5
0
文件: views.py 项目: jemora/eventoL
def sede_report(request, sede_url):
    sede = Sede.objects.get(url__iexact=sede_url)
    collaborators = Collaborator.objects.filter(sede=sede)
    installers = Installer.objects.filter(collaborator__sede=sede)
    talk_proposals = TalkProposal.objects.filter(sede=sede)
    votes = Vote.objects.all()
    sede_data = {
        'votes_for_talk': count_by(votes, lambda vote: TalkProposal.objects.get(
            pk=vote.object_id, sede=sede).title, lambda vote: vote.vote),
        'staff': get_staff(talk_proposals, installers, collaborators)
    }
    return HttpResponse(json.dumps(sede_data), content_type="application/json")
示例#6
0
文件: reduces.py 项目: jemora/eventoL
def installers(installers):
    data = {
        'total': installers.count(),
        'installers_for_level': count_by(installers, lambda inst: inst.level)
    }
    return data
示例#7
0
def installers(installers):
    data = {
        'total': installers.count(),
        'installers_for_level': count_by(installers, lambda inst: inst.level)
    }
    return data