예제 #1
0
def calorie_graph_data(request):
    session = Session()
    food_entries = session.query(FoodEntry).order_by(FoodEntry.date).all()
    food_days = FoodDay.group_days(food_entries)
    tags = session.query(FoodTag).order_by(FoodTag.id)
    session.close()
    return {'food_days': map(lambda x: x.to_dict(), food_days), 'tags': map(lambda x: x.to_dict(), tags)}
예제 #2
0
def food_entry_list(request):
    session = Session()
    food_entries = session.query(FoodEntry).order_by(FoodEntry.date)
    food_days = FoodDay.group_days(food_entries)
    session.close()
    return {'title': 'Food Entries', 'food_entries': food_entries, 'food_days': food_days}
예제 #3
0
def calorie_graph(request):
    session = Session()
    food_entries = session.query(FoodEntry).order_by(FoodEntry.date)
    food_days = FoodDay.group_days(food_entries)
    session.close()
    return {'title': 'Calorie Graph', 'food_entries': food_entries, 'food_days': food_days}