Re: Queryset - exclude one data over two

2019-01-26 Thread Stéphane Manguette
Thanks ! It works perfectly ! Le vendredi 25 janvier 2019 17:07:05 UTC+1, C. Kirby a écrit : > > You can use islice from itertools in this way > > islice('ABCDEFG', 0, None, 2) --> A C E G > > In your case you would replace > chart = temp_db.objects.filter(date__gte=beg_range) > > with > chart =

Re: Queryset - exclude one data over two

2019-01-25 Thread C. Kirby
You can use islice from itertools in this way islice('ABCDEFG', 0, None, 2) --> A C E G In your case you would replace chart = temp_db.objects.filter(date__gte=beg_range) with chart = [x for x in islice(temp_db.objects.filter(date__gte=beg_range), 0, None, 2)] That will give you every other