0

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?
  • You would need to save timezone information for each user, do you have anything that could be used for this? – Iain Shelvington Jul 14 '19 at 16:25
  • Regarding the Checks - the user enters data on the app when they complete a check? – Iain Shelvington Jul 14 '19 at 16:28
  • I don't have anything for saving a user's timezone, but I can look into that. Thank you. For the checks, the user basically says, "Yes, I did my homework," which marks it as completed for that particular day. – Lance Goyke Jul 15 '19 at 04:15

0 Answers0