def food_product(food_amount, key, *args, **kwargs):
    """ Template tag for getting true calory (etc.) values of FoodAmounts.

        Takes a FoodAmount object and an attribute name (key)
        Returns the attribute value per gram multiplied by the amount
    """
    return round(food_amount.amount * getattr(food_amount.food, key), 2)