I have the following django filter query:
ids = Worksheet.objects.filter(main=main_rec_id).values_list('id', flat=True)
But it return long values like [5L, 6L]
how can I get a list like [5,6] guys? Thanks in advance.
I have the following django filter query:
ids = Worksheet.objects.filter(main=main_rec_id).values_list('id', flat=True)
But it return long values like [5L, 6L]
how can I get a list like [5,6] guys? Thanks in advance.
use this
ids = Worksheet.objects.filter(main=main_rec_id).values_list('id', flat=True)
ids = map(lambda x:int(x),ids)
ids will be pure integer LIST
[5L, 6L] has no effect for using as [5, 6], because 5L == 5.