The Return of Django Pagination json

I am here with a problem that does not quite know how to solve it. I have this query:

result = json.dumps([a.get_json() for a in Player.objects.filter(name=namepost)])

But now I want to return the result with paging and I don’t know how to do it ... I saw in the documentation to use Paginator.

But, for example, when I do this,

p = Paginator(result, 2)
    print p.count

It gives 1609 ... and the query result is 3 records.

Can anybody help me?

+4
source share

All Articles