On Fri, Feb 6, 2009 at 3:05 PM, May <[email protected]> wrote:

>
> I have data entry clerks typing the data, so I cannot have them type
> the titles twice.


I'm quite sure Jeff wasn't suggesting having anyone type the titles in
twice.  Rather, when something with a title is saved, you have code (maybe
in a save() override) that automatically populates a "stripped" version of
your title field, based on the value of the title that was entered.  (There
is a simple strip_tags function in django.utils.html.)  Then, in the
database, you have both the field you have now (which contains html tags
like <em>) and a stripped version, and it is the stripped version that you
search, since people aren't going to be entering the html tags when they are
searching.



> Is there a command where I could strip the tags out
> after the keywords are typed but before python goes to the database to
> search?


? From what you've said the <em> tags are in the data stored in the
database, not in the query keywords.  There's no way to strip the tags from
the database data in order to do a search.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to