[Tkinter-discuss] Tkinter (python 3) and Sql-Alchemy

Russell Adams RLAdams at AdamsInfoServ.Com
Tue Jan 29 00:22:14 CET 2013

On Sat, Jan 26, 2013 at 06:37:11PM +0100, Michael Lange wrote:
> I don't know anything about sql-alchemy, from what you write my first
> idea too was to subclass StringVar and add a datatype attribute to the
> new SqlVariable class and let get() and set() handle the conversions
> according to self.datatype. If you have only the five mentioned datatypes
> I think this shouldn't be too hard and might prove quite handy then.

So I've just tried this, with verbose logging.

I've overridden the set method to also try to set the DB object to the
native value with a conversion, and soft failure (ie: if you haven't
finished typing a date, it doesn't bomb, it just doesn't update the DB

Making changes on the screen (ie: typing in a widget) doesn't appear
to call set at all, my debugging messages never even pop up. Thus the
DB object is never updated.

Did I misunderstand something in your suggestion?

I'm thinking I may need to add a trace that does the sync, not
override set().


Russell Adams                            RLAdams at AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

More information about the Tkinter-discuss mailing list