I am new to django, I want to get the id that has the name field contains "John". Below snippet code runs very well but,
In view.py
all_ids=Employee.objects.filter(name__contains = 'John').values('id')
return HttpResponse(" All id= %d " %all_ids)
It returns :
All id=[{'id': 1},{'id':2} , so on '...(remaining elements truncated)...']
There is a limitation to display 20 the items. So, How can I get rid of this limitations and (remaining elements truncated) ? Is there a better way to get a field's all values in a query without truncated ?
one way to do override it would be
all_ids= list(Employee.objects.filter(name__contains = 'John').values('id'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With