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

Michael Lange klappnase at web.de
Sat Jan 26 18:37:11 CET 2013


On Fri, 25 Jan 2013 18:50:56 -0600
Russell Adams <RLAdams at AdamsInfoServ.Com> wrote:

> Does anyone have any code samples, best practices, or could recommend
> other open source programs that use tkinter and sql-alchemy that
> correctly demonstrate how to work with the pair?
> I've tried a few methods now, including using Variables (ie: IntVar,
> StringVar, etc), tracing those variables, and now I'm working through
> creating a class which would inherit from Variable but perform the
> type conversions.

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.

For the date and time datatypes maybe you could borrow some code from the
Pmw.EntryField validation mechanisms.



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Vulcans worship peace above all.
		-- McCoy, "Return to Tomorrow", stardate 4768.3

More information about the Tkinter-discuss mailing list