Prometheus
Prometheus

Reputation: 33655

Django returning said rows in a queryset

Using a queryset in Django (in a view) I only want to get said rows 51-100. i.e. I only want it to return these rows.

is this possible and how within .

 objectQuerySet = Recipient.objects.filter(incentiveid=incentive).order_by('fullname')

I don't want to use any paging system etc this is just a one time thing?

Thank you

Upvotes: 0

Views: 69

Answers (1)

dm03514
dm03514

Reputation: 55972

You can use slicing to execute a LIMIT OFFSET statement:

objectQuerySet = Recipient.objects.filter(incentiveid=incentive).order_by('fullname')[51:100]

Upvotes: 5

Related Questions