Manager.Raw() + Pagination

768 views
Skip to first unread message

huw_at1

unread,
Jun 2, 2010, 2:52:49 AM6/2/10
to Django users
Hi all,

I'm trying to use Djangos new Raw feature to run a custom SQL and
return back a list of objects. This works fine however I then want to
paginate to present the results as a list. The RawQuerySet has no
length value it seems to be able to paginate. Is there a recognised
way of achieving this? Do I also need to run a "SELECT COUNT(*)" or
should I look at writing my own pagination?

Many thanks

huw_at1

unread,
Jun 4, 2010, 4:26:50 AM6/4/10
to Django users
Ah I solved this now by realising I simply needed to cast the
RawQuerySet as a list.
Reply all
Reply to author
Forward
0 new messages