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
The queryset's extra() method can help you with that:
MyModel.objects.extra(where=["replace(db_column_name, , '') = %s"],
params=["rockn burger"])
(Be careful if you're typing that in manually -- there are lots of
single-quotes in it)
Ian
On Fri, Jul 20, 2012 at 4:02 PM, Ada Pineda
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
3 matches
Mail list logo