예제 #1
0
def tot_cost(user):
    sum1 = 0
    #print(user)
    try:
        s1 = Food.get(Food.owner_id == user).cost
        if s1 is not None:
            sum1 = s1 + sum1
            print("the total cost of food is")
            print(s1)
    except:
        pass
    try:
        s2 = Activity.get(Activity.owner_id == user).cost
        if s2 is not None:
            sum1 = s2 + sum1
            print("Cost of your activity is")
            print(s2)
    except:
        pass

    try:
        s3 = Room.get(Room.owner_id == user).cost
        if s3 is not None:
            sum1 = s3 + sum1
            print("Cost of your Room is")
            print(s3)

    except:
        pass

    print(sum1)
예제 #2
0
def edit_food(food_id):
    food = Food.get(Food.id == food_id)
    foods = Food.select()
    return render_template("add.html", foods=foods, food=food)