Beispiel #1
0
    def handle(self, *args, **kwargs):
        count_ext = 0
        for identity in HotlineEvent.objects.values('identity').distinct():
            indicator, number = clean_phone_number(identity.get('identity'))
            if indicator != '223':
                count_ext += 1

        count = [(operator, HotlineEvent.objects.filter(
            operator=operator).values('identity').distinct().count())
                 for operator in operators()] + [("Exterieur", count_ext)],
        for operator, opcount in count[0]:
            print(operator)
            print(opcount)
    def handle(self, *args, **kwargs):
        count_ext = 0
        for identity in HotlineEvent.objects.values('identity').distinct():
            indicator, number = clean_phone_number(identity.get('identity'))
            if indicator != '223':
                count_ext += 1

        count = [(operator, HotlineEvent.objects.filter(operator=operator)
                                                .values('identity').distinct()
                                                .count())
                  for operator in operators()] + [("Exterieur", count_ext)],
        for operator, opcount in count[0]:
            print(operator)
            print(opcount)
Beispiel #3
0
def blacklist(request):
    context = get_default_context(page="blacklist")

    if request.method == "POST":
        identity = request.POST.get("identity").strip()
        ind, number = clean_phone_number(identity)
        identity = join_phone_number(ind, number)
        if not BlackList.objects.filter(identity=identity).count():
            BlackList.objects.create(identity=identity)
        else:
            b = BlackList.objects.get(identity=identity)
            b.call_count += 1
            b.save()
            messages.success(request, "%s ajouté dans la liste noire" % b.identity)

    context.update({"blacknums": BlackList.objects.all()})

    return render(request, "blacklist.html", context)
Beispiel #4
0
def blacklist(request):
    context = get_default_context(page='blacklist')

    if request.method == 'POST':
        identity = request.POST.get('identity').strip()
        ind, number = clean_phone_number(identity)
        identity = join_phone_number(ind, number)
        if not BlackList.objects.filter(identity=identity).count():
            BlackList.objects.create(identity=identity)
        else:
            b = BlackList.objects.get(identity=identity)
            b.call_count += 1
            b.save()
            messages.success(request,
                             "%s ajouté dans la liste noire" % b.identity)

    context.update({'blacknums': BlackList.objects.all()})

    return render(request, "blacklist.html", context)