Open AndyPaPaLeu opened 3 years ago
########################### (e.g.在10/10晚餐, 增加apple) meal_query = {'name':'dinner','inTake':['burger','banana'],'time':datetime.strptime('2020-10-10-18:30:30', datetime_string_type)} #original new_item_info = {'name':'dinner','inTake':['apple'],'time':datetime.strptime('2020-10-10-18:30:30', datetime_string_type)} item = Meal(name=new_item_info['name'], time=new_item_info['time']) item.add_food(new_item_info['inTake']) print(item.food_summamry())
print('\nnew_item_info to existed dailyintake_dict')
for data in [new_item_info]: new_item=Meal(data['name'],data['time']) new_item.add_food(new_item_info['inTake']) dailyintake_dict[data['time'].strftime(date_string_type)].add_meal(new_item)
person.update_dailyIntakes(dailyintake_dict)
print('===take a look from person===') for date, daliyintake in person.get_dailyIntakes().items(): print(date,daliyintake.total_intake_calories) print(daliyintake.meal_detail()) ###########################
[pathway] frontend -> person -> dailyIntake -> meal -> food person -> connecter -> meal table
[input] date, meal list
[output] None