I have an application I am building using wxpython with postgresql as my database. I don’t know what is the right approach to send the data from GUI to the database but what I am doing is storing the GUI(txtctrl) output in dictionary and trying to send it to postgresql. My question is: Is there any way to send the data to the database using sqlalchemy where dictionary keys acts as the column_fields and dictionary-values as its values.Is there more elegant way to do the data-communication between GUI and database?
I have an application I am building using wxpython with postgresql as my database.
Share
Supposing you are using
declarativesin sqlalchemy, and your object name is Object, you can use:That’s only if you are using the ORM and declarative. (You mentioned sqlalchemy, so I guess it does not change if it’s postgresql or another one)
EDIT: I think you are going for the right approach, just make sure you use
wx.Validators for your forms and store in a dictionary the data, it’s very practical.