Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

dcc.Input Textbox to Allow Insertion of Apostrophes to Postgre database

$
0
0

Hi,

We currently created an app using Dash as the front-end framework while Postgres for its back-end database. So my only question is, given I have a dcc.Input with type Text, I can type any text on it including apostrophes (’), however, using a callback to insert the value from that input into postgres will not allow because of the single apostrophe.

sql= '''INSERT INTO stores (store_name, store_delete_ind) VALUES(%s,%s)'''
values = (storenamefrominput, False)

insertintodb(sql, values)

Where insertintodb() is a defined function connecting to the postgres db.

Of course in postgres, we know that to insert apostrophes, we just use 2 single apostrophes. But in my callback, it will not be allowed unless the user specifically inputted 2 single apostrophes.

I hope you can help me with this. Thank you!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images