>How could I have different templates for the search form/results?

In my case it's part of the model itself - I have a template tag
"embed" that just does the right thing for each class that might be
searched. In your case you could just have different search result
templates and have two views that both use the search generic view, but
get passed different template names in the info_dict.

I usually don't have different search forms, but just one that searches
over all models that have search capability - if I need some "search
context" (like in the "Zeitgeist" view, where some search keywords are
predefined), I just add those to the search query string. So in your
case you could just add the kind:users in the user search and put the
template_name into the paramter to the generic view - for example by
writing small wrappers around the generic view.

>Could I paginate the search result?

Not with the standard generic view - I never looked into the pagination
stuff and so don't even know what to do to enable it there. I usually
just set the max_number to limit the maximum number of results returned
and order them by creation date.

You could do that yourself by not using the generic view but using the
high level search interface - it's rather simple to use, only three
functions:

parse: this function parses a query string into a query description
search: this uses the query description to query all defined search
definitions
merge: this merges the different resultsets from all search definitions
into one big result

You could do the querying in one line like this:

result = merge(search(*parse(query_string)), -1)

this would return all results for a given query. Then you could build
your own paginated view on that result.

bye, Georg

Reply via email to