I have a full web-page working and now I am debugging the errors. Until now, the only one I can't get rid of is when the input on my web-page introduces a symbol (+, *, ~,...)
If I change the operator: op('~* ') for a like, it works but I don't need the like operator, I need the case insensitive op('~* ')
# first, i take from my web the filter that an user have introduced
filter_tag = str(request.form.get('filter_tag'))
if take_filter.filter_tag != '':
conditions.append(clothes.c.column_tag==filter_tag)
query = session.query(clothes).filter(and_(*conditions),).distinct(clothes.c.nummer).order_by(clothes.c.nummer)
It works perfectly with a normal text but if the user introduces a sign (*, ~, +,...) it returns an error:
sqlalchemy.exc.DataError: (psycopg2.DataError) invalid regular expression: quantifier operand invalid