Alex Rivera | Logout

django remaining elements truncated

Asked 2012-09-26T20:11:09.290
11

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 ?

Edit
Report

1 Answer

14

one way to do override it would be

all_ids= list(Employee.objects.filter(name__contains = 'John').values('id'))
answered 2012-09-26T20:34:45.433

Your Answer