statistics overtime days per month
Using your database engines admin interface, create a simple table in your database:
"CREATE TABLE `overtime` (
`month` varchar(11) DEFAULT '',
`day` varchar(11) DEFAULT '',
`overtime` tinyint(1) DEFAULT '0',
PRIMARY KEY (`day`)
) ENGINE=MyISAM DEFAULT CHARSET=latin;"
And an initial row:
insert into overtime (month, day, overtime) values('201402', '20140201', 0);
Return to overtime.py to change the datebase config, while the forsae branch you do not need to change it.
db = web.database(dbn='mysql', user='db_user', pw='db_pwd', db='db_dbname')
The value of the overtime in database is 0 means "work normal" whereas 1 means "work overtime".
Run server:
python overtime.py port