Background
I'm a personal trainer and trying to build an app that tracks whether or not my clients are working on their daily habits (and bugs them about it at a chosen time every day). I'd love to hear if any of you all have ideas on how to structure this as I'm new to both Django and coding in general.
Models
I currently have two models: Habits
and Checks
.
Habits
represent "What are you working on improving?" and have a ForeignKey to a user.
Checks
represent "Did you complete your habit today?" and have a ForeignKey to a habit.
Current status
There is a nice solution where you create all the Checks for a Habit based on it's end date, but I'm trying to structure this with an indefinite end date because, as a coach, then I can show hard data when someone isn't making progress. Though I am still willing to accept that maybe this app would work better if habits had deadlines.
I wrote a custom manage.py script that Heroku runs automatically at the same time every day, but that doesn't scale with users' individual time zones. I run it manually on my local computer.
I originally tried getting it to work with Celery but that did not go well on my Windows machine.
Should I push the script out a day or week in advance and hide the days that are in the future? Should I avoid the script and just create a year's worth of rows and hope they don't want to track it for more than a year? Is there a better option?
Help requested
The two issues I'm having at this point:
- How can I have a Check created for each day? Is there a better way than what I've done already?
- How can I make the timezone for each day relative to the user?