mysqldb.py with the foreign key