Re: Multi-page search result

2008-01-28 Thread Wanrong Lin
What a pleasant surprise! I am glad that I asked the question, even though I thought I had googled through everything. Thanks a lot for pointing these goodies out. Wanrong SmileyChris wrote: > Using the low-level cache [1] sounds like it'd work fine for you. > > from django.core.cache import

Re: Multi-page search result

2008-01-27 Thread gordyt
SmileyChris the ObjectPaginator is cool and I'm glad you pointed it out. In my particular case I needed to be able to do more than just paginating large datasets, but for the O.P. it sounds great! --g --~--~-~--~~~---~--~~ You received this message because you a

Re: Multi-page search result

2008-01-27 Thread SmileyChris
Using the low-level cache [1] sounds like it'd work fine for you. from django.core.cache import cache key = 'complex-results-%s' % request.session.id results = cache.get(key) if results is None: results = list(YourComplexQuery) cache.set(key, results, 60*15) # then just use pagination to

Re: Multi-page search result

2008-01-27 Thread Wanrong Lin
Hi, Gordon, Thanks a lot for sharing the details of your solution on this problem. So far I don't see any approach better than what you did, namely storing the results in some temporary place that is tied to a session. So I think I will just go along with this approach. I have not read carefu

Re: Multi-page search result

2008-01-27 Thread gordyt
Hi Wanrong, This is a very good question. I had a similar problem that I ended up solving with a non-Django solution because I was adding it to an existing PHP-based site. But I would like to describe what I ended up doing to see if it would be possible to adapt it to Django. In out case we ha

Multi-page search result

2008-01-27 Thread Wanrong Lin
Hi, I wonder whether I can learn some best practice here on how to do multi-page search result, similar to what Google does. My search is computation intensive, and it will be very expensive to do the search all over from beginning when the user clicks on "next page". I am thin