The remaining django elements are truncated

I am new to django, I want to get an identifier in which the name field contains "John". Below code snippet works 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 limit to display 20 items. So, how can I get rid of these restrictions and (the remaining elements are truncated)? Is there a better way to get a field for all values ​​in a query without truncating?

+7
source share
1 answer

One way to do an override is

 all_ids= list(Employee.objects.filter(name__contains = 'John').values('id')) 
+10
source

All Articles