Creating a duplicate field without tags looks like it might be the way
to go, then.  I just hate the redundancy of two fields of data.
Thanks to both you and Jeff!

May

On Feb 6, 12:30 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> On Fri, Feb 6, 2009 at 3:05 PM, May <adles...@gmail.com> 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 django-users@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