To clarify - is your problem removing apostrophes, or having a search mechanism that can accommodate variations in punctuation?
If the answer is the former, then the answer Ian gave is on the right track. However, if your actual problem is full-text search, then there are some better options. If you set up a full text search index, you'll be able to allow for punctuation, spelling errors, word stems (e.g., a search for "teacher" finding "teachers") and much more. django-haystack is the place to start looking; Haystack is a Django wrapper around a bunch of search backends (Solr, ElasticSearch, Whoosh, and Xapian). If this is your first look into search backends, I'd suggest using Elastic Search -- it's really easy to get going, and is pretty powerful too. Of course, if you're planning to put this into production, you'd be well served to take a look at the other options, too. Yours, Russ Magee %-) On Sat, Jul 21, 2012 at 7:02 AM, Ada Pineda <elizethpin...@gmail.com> wrote: > Hello > > I'm asking for your help because I need to do a query on a table that has a > field that contains apostrophes, but I need to ignore them (apostrophes) > when I'm doing the query. I have to save the data as it is, so I can't just > take away those apostrophes before saving to the database. I mean, if the > database has "rock'n burger" and a user types "rockn burger", I need to get > the value with apostrophe from the database. > > Can anyone help me? > > Thanks a lot! > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/lxGzVjrwQgMJ. > 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. -- 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.