It can be achieved using a Search model, but only if you only need  
search on a single model.

class YourModel(models.Model):
   ...
clsss Search(models.Model):
   yourmodels = models.ManyToManyField(YourModel)

So the search form is POST not GET. After POST'ing, you do the  
searching, then create a new Search object, store the results into  
it's yourmodels field, and save it. Next you'll need a search results  
view which takes a search ID. That view only needs to do  
Search.objects.get(pk=search_id).yourmodels.all() to get the results  
(or yourmodels.all()[m, n] if you're doing pagination. This way you'll  
have short URL's for search results (like /search/8293/).

If you need to search across multiple models, I'd consider django- 
search or similar.

Erik

On 29.09.2008, at 5:12, Brandon Taylor wrote:

>
> Hi everyone,
>
> I have a search results page and need to be able to go to a detail
> page for any result. I would like to provide the user a way to return
> to their search results and not clutter the querystring with search
> parameters.
>
> What's the best approach for this using Django? Should I stuff the
> queryset into a session?
>
> TIA,
> Brandon
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to