Am 12.09.2012 um 14:47 schrieb Daniel Roseman:

>> Am 12.09.2012 um 10:27 schrieb Stephen Anto: 
>> 
>>> There are lots of sources available on net for Django pagination. I am 
>>> using django pagination on my website http://www.f2finterview.com/ for 
>> show 
>>> questions and answers. 
>>> 
>>> each request fetches only five questions and answers (Eg. 
>>> http://f2finterview.com/web/Django/) 
>> Is this lazy fetching, i.e. are the rows fetched, when I step into that 
>> page, or immediately?
Anybody has an answer to this?
I'm dealing with millions of rows and don't wan't them to be fetched at all.
>> I tried Subclassing Paginator and slicing: 
>> --- 
>> class OneShotPaginator(Paginator): 
>>    def __init__(self, object_list, per_page, orphans=0, 
>> allow_empty_first_page=True): 
>>        super(OneShotPaginator, self).__init__(object_list[:20], per_page, 
>> orphans, allow_empty_first_page) 
>> --- 
>> This did not reduce the number of displayed rows to 20. 
>> Only the summary count at  the botton is now 20. )-8 
>> Any glue? 
>>> 
>>> On Wed, Sep 12, 2012 at 1:44 PM, Axel Rau <axel...@chaos1.de<javascript:>> 
>> wrote: 
>>> 
>>>> I have a table with lots of IP addresses. 
>>>> I defined some search_fields and that works well. 
>>>> How can I limit the amount of fetched and displayed rows (and pages)? 
>>>> A filter which slices the QuerySet to display only the first 100 
>> results, 
>>>> would do it, but I do not know, how to create a filter, which produces 
>> no 
>>>> widgets and does not filter on a specific field. 
>> 
>> Axel 
>> --- 
>> PGP-Key:29E99DD6  ☀ +49 151 2300 9283  ☀ computing @ chaos claudius 
>> 
>> 
> Why do you need to subclass Paginator? The whole point of the class is that 
> it already deals with slicing appropriately. Just set the per-page 
> parameter to whatever you need.
You didn't get it.
I don't want to limit the number of rows per page and the number of pages but 
the number of rows fetched.
The row(s) to be inspected and changed have to be selected by search_fields.
I don't want the app to blow up with empty (or not specific enough) search 
string.

Axel
---
PGP-Key:29E99DD6  ☀ +49 151 2300 9283  ☀ computing @ chaos claudius

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to