These are chat archives for django/django

27th
Feb 2017
Kazi Sadman Ahmed
@sadmanbd
Feb 27 2017 04:21
Hey, anybody use django with vue-cli?
Subha Bera
@subha-py
Feb 27 2017 04:31
Yes I do @sadmanbd
Daniel S. Bess
@dbess
Feb 27 2017 04:32
Hi
Kazi Sadman Ahmed
@sadmanbd
Feb 27 2017 04:33
How did you configure it? I started a django project. Ran vue init webpack . in the same project folder. Installed webpack-bundle-tracker. But lost it at webpack.config.json.
Subha Bera
@subha-py
Feb 27 2017 04:34
I am a bit busy right now..
It will be better if you open a question at stack overflow and send me the link
I will answer it whenever I will be free @sadmanbd
Kazi Sadman Ahmed
@sadmanbd
Feb 27 2017 04:34
Ok thanks
Alexandro Pequeno
@Argestis
Feb 27 2017 09:28
For all the experienced web developers in here. What's your opinion on how many back-end frameworks is a good idea to master?
Miracle Ayodele
@iammiracle
Feb 27 2017 10:38
anyone online to help me on iterating through queryset?
Mowee
@heyimmowee
Feb 27 2017 10:40
Someone could do that if you give some more informations
What qs
Miracle Ayodele
@iammiracle
Feb 27 2017 10:51
i am trying to get the total amount a user donate, which i got
but there is a limit to which the user can donate
so i need to iterate through so that when it reaches the maximum amount the user wont be able to donate anymore
@heyimmowee got me?
Mowee
@heyimmowee
Feb 27 2017 10:54
@koderNeptune Not sure to get it
Why don't you use Sum() ?
Miracle Ayodele
@iammiracle
Feb 27 2017 10:54
total_amount = PairMembers.objects.filter(get_help_request_id=get_help_id).aggregate(
Sum('getters_collected_amount'))
yeah i did that, but i only get the last saved donation
that is, it sums up the amount before save
if request.POST:

    getters_balance = int(request.POST.get('getters_total_amount', False))
    money_collected = int(request.POST.get('provider_amount', False))
    a = int(request.POST.get('provider_amount', False))
    b = int(request.POST.get('getters_total_amount', False))
    c = 0
    get_help_id = request.POST.get('get_help_id', False)


    total_amount = PairMembers.objects.filter(get_help_request_id=get_help_id).aggregate(
        Sum('getters_collected_amount'))


    while total_amount > getters_balance:
        print total_amount
        print "still less"

        if form.is_valid():
            match1 = form.save(commit=False)
            match1.getters_collected_amount = c + a
            match1.get_help_request_id = request.POST.get('get_help_id', False)
            match1.save()
Mowee
@heyimmowee
Feb 27 2017 10:57
PairMembers are members that can receive donations from providers ?
Miracle Ayodele
@iammiracle
Feb 27 2017 10:59
yeah
Mowee
@heyimmowee
Feb 27 2017 11:00
I guess donations are stored with a specific model
Can you paste your PairMembers model and the Donation one ?
The correct Queryset should be something like Donation.objects.filter(pairmember=<id_pairmember>).aggregate(total_amount=Sum('amount'))