added stool tracking + toothbrushing tracking
This commit is contained in:
@@ -16,10 +16,13 @@ class CheckInStreaks:
|
||||
|
||||
|
||||
def is_low_pain(check_in, threshold=LOW_PAIN_STREAK_THRESHOLD):
|
||||
return (
|
||||
check_in.neck_pain_severity <= threshold
|
||||
and check_in.headache_severity <= threshold
|
||||
)
|
||||
"""A confirmed low-pain day needs both scores in every time period."""
|
||||
for period, _, _ in check_in.PERIODS:
|
||||
neck = getattr(check_in, f"{period}_neck_pain_severity")
|
||||
headache = getattr(check_in, f"{period}_headache_severity")
|
||||
if neck is None or headache is None or neck > threshold or headache > threshold:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def calculate_check_in_streaks(check_ins, as_of_date, threshold=LOW_PAIN_STREAK_THRESHOLD):
|
||||
|
||||
Reference in New Issue
Block a user