First off, the server keeps session data, not the browser, but I
understand what you're talking about. There's no real way without
extra programming to handle that, but here's a scheme that should be
fairly minimal:

(1) On the "Search Results" page, create a new list in the session
variable 'refineResultCommands' and put a dictionary in it with two
variables - randomKey and querySet. randomKey could just be a random
number between 1 and 1000.
(2) Use a form for the refinement. Have a hidden field that passes the
randomKey.
(3) On the refinement page, compare each stored randomKey with the
randomKey from the hidden field. If they match, display the refined
results. If no randomKeys match, then display a field that says
"Search first, then refine."

Regards,
Leaf

On Aug 31, 4:53 pm, Egon Esser <[EMAIL PROTECTED]> wrote:
> > When the user enterssearchtermsand submits the form it doesn't pass
> > a queryset object to the view.  Your view gets called (with a GET or
> > POST) and gets passed in arequestobject.  You grab the parameters
> > out of that (preferably using the spiffy Django forms to help you
> > handle validation) and then you create a queryset in your view method.
>
> OK, I've now looked up some examples for that in the meantime, looks
> pretty much straight-forward.
>
> > But I see what you are asking, which is how to maintain an existing
> > queryset across multiple views.  Seems like you could easily stash
> > that away
> > in the session data.  This is covered here:
>
> >http://www.djangoproject.com/documentation/db-api/#pickling-querysets
>
> Thanks for the pointer, I hadn't encountered this stuff before at all.
>
> > Essentially, you don't pickle the actual QuerySet object, you pickle
> > the "query" attribute of the QuerySet object.
>
> Ah, OK.
>
> I'm just asking myself now: doesn't a browser keep the same session
> data for the same logged-in user?
> I.e., if a user browses the site in two browser tabs of the same
> browser, logs in in both, but places different searches on the site
> between the browser tabs?
>
> Would the browser in some way signal that the next request comes from
> a different tab? I don't think so, but then again, I may not know
> enough of web technologies.
> Even so, I assume it would call for programming some sort of manager
> to handle that (doesn't seem clean) - otherwise, searching first in
> tab1 and then in tab2, and then again refining the search in tab1
> would cause conflicting filtered results.
>
> EE
--~--~---------~--~----~------------~-------~--~----~
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