Home World Data ai sql seed waveforms [OC]DDataai sql seed waveforms [OC]September 15, 2024 ai sql seed waveforms [OC] Posted by Original_Building800 2 commentssource: ai written code`# Seed data for fasting_periods``fasting_periods = []``# Starting from 30 days ago``current_time = datetime.now() – timedelta(days=30)``for _ in range(30):``# Fasting period: 20:00 to 12:00 next day (16 hours fasting)``fasting_start = current_time.replace(hour=20, minute=0, second=0, microsecond=0)``fasting_end = (fasting_start + timedelta(hours=16)).replace(microsecond=0)``fasting_periods.append({``’id’: str(uuid.uuid4()),``’user_fasting_plan_id’: user_fasting_plan_id,``’start_time’: fasting_start.isoformat(),``’end_time’: fasting_end.isoformat(),``’period_type’: ‘fasting’ # ENUM compliant``})``# Eating period: 12:00 to 20:00 same day (8 hours eating)``eating_start = fasting_end``eating_end = (eating_start + timedelta(hours=8)).replace(microsecond=0)``fasting_periods.append({``’id’: str(uuid.uuid4()),``’user_fasting_plan_id’: user_fasting_plan_id,``’start_time’: eating_start.isoformat(),``’end_time’: eating_end.isoformat(),``’period_type’: ‘eating’ # ENUM compliant``})``# Move to next day``current_time = eating_end + timedelta(seconds=1) # Ensures no overlap`Is fasting just time you are not actively eating? How would fasting hours go down with some slope and not instantly?Leave a ReplyYou must be logged in to post a comment.
source: ai written code`# Seed data for fasting_periods``fasting_periods = []``# Starting from 30 days ago``current_time = datetime.now() – timedelta(days=30)``for _ in range(30):``# Fasting period: 20:00 to 12:00 next day (16 hours fasting)``fasting_start = current_time.replace(hour=20, minute=0, second=0, microsecond=0)``fasting_end = (fasting_start + timedelta(hours=16)).replace(microsecond=0)``fasting_periods.append({``’id’: str(uuid.uuid4()),``’user_fasting_plan_id’: user_fasting_plan_id,``’start_time’: fasting_start.isoformat(),``’end_time’: fasting_end.isoformat(),``’period_type’: ‘fasting’ # ENUM compliant``})``# Eating period: 12:00 to 20:00 same day (8 hours eating)``eating_start = fasting_end``eating_end = (eating_start + timedelta(hours=8)).replace(microsecond=0)``fasting_periods.append({``’id’: str(uuid.uuid4()),``’user_fasting_plan_id’: user_fasting_plan_id,``’start_time’: eating_start.isoformat(),``’end_time’: eating_end.isoformat(),``’period_type’: ‘eating’ # ENUM compliant``})``# Move to next day``current_time = eating_end + timedelta(seconds=1) # Ensures no overlap`
Is fasting just time you are not actively eating? How would fasting hours go down with some slope and not instantly?
2 comments
source: ai written code
`# Seed data for fasting_periods`
`fasting_periods = []`
`# Starting from 30 days ago`
`current_time = datetime.now() – timedelta(days=30)`
`for _ in range(30):`
`# Fasting period: 20:00 to 12:00 next day (16 hours fasting)`
`fasting_start = current_time.replace(hour=20, minute=0, second=0, microsecond=0)`
`fasting_end = (fasting_start + timedelta(hours=16)).replace(microsecond=0)`
`fasting_periods.append({`
`’id’: str(uuid.uuid4()),`
`’user_fasting_plan_id’: user_fasting_plan_id,`
`’start_time’: fasting_start.isoformat(),`
`’end_time’: fasting_end.isoformat(),`
`’period_type’: ‘fasting’ # ENUM compliant`
`})`
`# Eating period: 12:00 to 20:00 same day (8 hours eating)`
`eating_start = fasting_end`
`eating_end = (eating_start + timedelta(hours=8)).replace(microsecond=0)`
`fasting_periods.append({`
`’id’: str(uuid.uuid4()),`
`’user_fasting_plan_id’: user_fasting_plan_id,`
`’start_time’: eating_start.isoformat(),`
`’end_time’: eating_end.isoformat(),`
`’period_type’: ‘eating’ # ENUM compliant`
`})`
`# Move to next day`
`current_time = eating_end + timedelta(seconds=1) # Ensures no overlap`
Is fasting just time you are not actively eating? How would fasting hours go down with some slope and not instantly?