Presumably the user entered data into a form to perform the search.
I'd save the form field values, possibly slightly pre-processed.
Remember to include stuff that you're pulling out of, for example,
request.user.  Then you can change the details of your search
function, your database schema, and a bunch of other things, and
still have the search work.

Pickling such stuff is probably safe if there are no classes involved,
but changing the definition of pickled classes can lead to trouble.
If you jsonify it instead, you can even change python versions and
have it still work.

On Wed, Apr 28, 2010 at 10:34 AM, Mark Jones <mark0...@gmail.com> wrote:
> When someone searches for something on the site and finds nothing, I
> want to save that query for later reuse (so I can run it each night to
> see if anything new matches their request, and email what is found to
> the user).
>
> What is the best way to go about this?
>  1. Save the SQL that is generated and just run it later?  If so,
> how? I'm going to want the ORM to be involved in this since I will be
> templating the emails.
>  2. Pickle the lookup?
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to