Re: Paginating complex queries

2005-11-23 Thread Afternoon
On 23 Nov 2005, at 15:07, Simon Willison wrote: The aim with the template system has always been to keep it de- coupled from the request/response stuff, so it can be used as a standalone component. It's hard to see how the request object could be exposed to custom tags without breaking tha

Re: Paginating complex queries

2005-11-23 Thread Simon Willison
On 23 Nov 2005, at 14:59, Afternoon wrote: Is there a way that the request object could be exposed to custom tag code, but not the template itself? The aim with the template system has always been to keep it de- coupled from the request/response stuff, so it can be used as a standalone c

Re: Paginating complex queries

2005-11-23 Thread Afternoon
On 23 Nov 2005, at 14:42, Colin Howlett wrote: +1 to putting the request object into the context as standard, or at least into DjangoContext. I've only been playing with Django for a few days, and it's already obvious that this single change would make writing useful custom tags a whole lot ea

Re: Paginating complex queries

2005-11-23 Thread Colin Howlett
+1 to putting the request object into the context as standard, or at least into DjangoContext. I've only been playing with Django for a few days, and it's already obvious that this single change would make writing useful custom tags a whole lot easier. Colin

Re: Paginating complex queries

2005-11-22 Thread Luke Plant
On Tue, 22 Nov 2005 07:09:06 -0800 [EMAIL PROTECTED] wrote: > What is the Django Way (tm) to paginate complex queries with > user-controlled parameters? That is, if I want to paginate the > results of a foos.get_list({'lots': 'of_complex', ['junk': 'in > here']}) where the query terms are submi

Re: Paginating complex queries

2005-11-22 Thread Tom Tobin
On 11/22/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > What is the Django Way (tm) to paginate complex queries with > user-controlled parameters? That is, if I want to paginate the results > of a foos.get_list({'lots': 'of_complex', ['junk': 'in here']}) where > the query terms are submitt

Re: Paginating complex queries

2005-11-22 Thread [EMAIL PROTECTED]
I've already dug into the paginator code. I was hoping there was a way to do it without having to munge query parameters by hand every time I get a new page. I thought my solution was bad but that code in the admin interface is pretty much the same sort of edge-case-ridden sin against nature. M

Re: Paginating complex queries

2005-11-22 Thread Gustavo Picon
Use the (undocumented) django.core.paginator class: http://code.djangoproject.com/browser/django/trunk/django/core/paginator.py You can see an example on how it works in: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/main.py in the change_list function, the one t

Paginating complex queries

2005-11-22 Thread [EMAIL PROTECTED]
What is the Django Way (tm) to paginate complex queries with user-controlled parameters? That is, if I want to paginate the results of a foos.get_list({'lots': 'of_complex', ['junk': 'in here']}) where the query terms are submitted via form, how should I go about that while maintaining the user-p