Hi, Pavel...

On Mittwoch, 9. Juli 2008, Pavel Skvazh wrote:
> I'd like to share a use case with paginate.
> I've got a model that serves query results in the format I need. It
> manages starts and limits, includes [totalrow] property so I just need
> paginate to draw a nice paging bar.
>
> Everything works fine, but one line messes it up for me.
>
> self.items = list(self.collection[self.first_item-1:self.last_item])
>
> Here it takes only the range from the passed array. My situation
> implies that I've already got full array fetched from the database, so
> I need it just to be left intact.
>
> so I changed it to self.items = list(self.collection) and it works
> like a charm.

Why do you do that? If you just use the .pager() method to draw the paging 
bar then you shouldn't need the self.items there (unless you use it 
somewhere else). However I think this case is kind of special and I'm 
hesitating to add that to the code right away.

Cheers
 Christoph

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to