Srry I didn't notice your other question earlier. From what I can tell Mezzanine does this by adding:
value="{{ request.REQUEST.keywords }}"
to the keywords input in the mezzanine equivalent of _search.html.
In Satchmo I would think this would mean simply updating:

<input type="text" size="19" name="keywords" id="search_keywords" />

in _search.html
to:

<input type="text" size="19" name="keywords" id="search_keywords" value="{{ request.REQUEST.keywords }}" />

But that isn't working for me. I might be missing something but hopefully that gives you a start. let me know if you figure it out!

-Josh


On 1/10/11 11:01 AM, hynekcer wrote:
Josh@: It is not redundant. The filter
   keywords = filter(None, keywords)
is helpful because if you write to searchbox only non alphanumerical
characters (e.g. one comma) it is changed by "strip(punctuation)" to
empty string and you get query
    ... UPPER(columnname) LIKE UPPER(E'%%') ...
and you eventually go out of memory or get timeout for a big database.

I limit however number of results usually by a slice in templates/shop/
search.html
   {% for category in results.categories|slice:":200" %}
...
   {% for product in results.products|slice:":200" %}
So, it would by load only for database, not for template system and
web browser, which would be worse.

Did you read my question about displayig keywords back to searchbox?
(above)
How it is done in Mezzanine?

Hynek

Josh Cartmell wrote:
Hey Hynekcer, I like your updates and incorporated them.  I also removed
the keywords = filter(None, keywords) as I think it is redundant and
unnecessary, I'm not totally sure on that because I'm not exactly sure
what purpose it was serving there. If someone could enlighten me or
confirm that it is unnecessary I would appreciate it.  Search continues
to function without it.

-Josh

--
You received this message because you are subscribed to the Google Groups "Satchmo 
users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.

Reply via email to