Collin thank so much really help me! Cheers
On Sat, Oct 4, 2014 at 11:09 AM, Collin Anderson <cmawebs...@gmail.com> wrote: > If you change how your dictionary is formatted, it can be much easier: > dicc_one = { > 'string1': {'fieldsFK__total_one__gt': 0}, > 'string2': {'fieldsFK__total_two__gt': 0}, > 'string3': {'fieldsFK__total_three__gt': 0}, > 'string4': {'fieldsFK__total_four__gt': 0}, > } > results = {} > for k, v in dicc_one.items(): > results[k] = Model.objects.filter(**v).count() > > Otherwise, you'll need to call v.split('=') to split the fields from the > values. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/18b83194-d01e-4bf2-8ff7-5990e4a5c9c5%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/18b83194-d01e-4bf2-8ff7-5990e4a5c9c5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM-7rO1UbCQHQsDadQ3OO5NMAAb%2B5PN08mws_WXw8%3DrXKr3CHA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.