Use the DB for timecontraints rather than Python