I think I get it... domains = g.objects.all() just makes the QuerySet and paginator = ObjectPaginator(domains, 10) executes the query limiting the records to the one requested...
Excellent Thanks for your help jhv On Mon, Aug 25, 2008 at 12:53 AM, Juan Hernandez <[EMAIL PROTECTED]>wrote: > >> Using the Pagniator makes it so that when you hit the DB, the retrieved >> results are limited to those relevant for the page you are displaying. You >> are not reading the whole table and then tossing away everything except what >> is on the page your are displaying, you are only reading from the DB what is >> actually going to be displayed on the requested page. So your hitting the >> DB for each request is not a problem. Don't worry about it. >> > > Thanks for your answer > > So, let's say that everytime i get a page, the internat query to the db > just gets the, lets say, 10 rows that I requested? because I'm using > objects.all(). In that process, where is the DB being hit? > > jhv > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---