https://github.com/Bcopeland64/IU-Habit-.../db.py#L26
After removing the comment the error is fixed.
Then when you try to create habit there is problem in
https://github.com/Bcopeland64/IU-Habit-.../db.py#L32
You
After fixing the import, there is problem with
https://github.com/Bcopeland64/IU-Habit-.../db.py#L78
when you instantiate
At that point I gave up
And something I didn't realise at first glance
You actually never use
DELETE CASCADE //added ON DELETE CASCADE to delete the related entries in completions when a row in habits is deletedThe "comment" is not valid SQL syntax for comment and this raise error.
After removing the comment the error is fixed.
Then when you try to create habit there is problem in
create_habit
with datetime.now()
https://github.com/Bcopeland64/IU-Habit-.../db.py#L32
You
import datetime
, however datetime
module does not has now()
method. You need to from datetime import datetime
in order for datetime.now()
to work.After fixing the import, there is problem with
get_habit
https://github.com/Bcopeland64/IU-Habit-.../db.py#L78
when you instantiate
Habit()
you pass more arguments than expected.At that point I gave up
And something I didn't realise at first glance
You actually never use
db.HabitDB
. You only work with habit.HabitTracker
. i.e. you never actually use the database part. The instance of HabitTracker
class is in-memory and all data is lost when program finish
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs