Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My First App
#7
(Feb-16-2023, 11:20 AM)buran Wrote: https://github.com/Bcopeland64/IU-Habit-.../db.py#L26
DELETE CASCADE  //added ON DELETE CASCADE to delete the related entries in completions when a row in habits is deleted
The "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

As always, thanks for all of your help. I will go back to the drawing board. I really appreciate your patience.
Reply


Messages In This Thread
My First App - by BCopeland64 - Feb-13-2023, 09:18 AM
RE: My First App - by buran - Feb-15-2023, 11:57 AM
RE: My First App - by BCopeland64 - Feb-15-2023, 05:46 PM
RE: My First App - by buran - Feb-15-2023, 07:21 PM
RE: My First App - by BCopeland64 - Feb-16-2023, 09:20 AM
RE: My First App - by buran - Feb-16-2023, 11:20 AM
RE: My First App - by BCopeland64 - Feb-16-2023, 11:52 AM
RE: My First App - by BCopeland64 - Feb-16-2023, 08:20 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020