Monday, October 26, 2009

Prevent to create an Instance of a Class

I think it's cool


class ClassName:
def __init__( self ):
if self.__class__ == ClassName:
raise NotImplementedError, "Cannot create object of this class"

Datastore




Friday, October 9, 2009

Tkinter_Checkbutton

from Tkinter import *

master = Tk()

var = IntVar()

def value() :
print var.get()

c = Checkbutton(master, text="Expand", variable=var, command = value)
c.pack()


mainloop()


result
***************
0
1
0
1

Thursday, October 8, 2009

python GUI TKINTER

Very good TKinter tutorial
http://www.ferg.org/thinking_in_tkinter/

Wednesday, October 7, 2009

SQlite foreign key

FOREIGN KEY constraints is not Supported
http://www.sqlite.org/omitted.html


The 'walk around' method : Use trigger
http://www.sqlite.org/cvstrac/fileview?f=sqlite/tool/genfkey.README

http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers

Tuesday, October 6, 2009

Create foreign key with SQlite

http://www.sqlite.org/cvstrac/fileview?f=sqlite/tool/genfkey.README