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 =
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
2 matches
Mail list logo