What is the use of .all(). When the following function
def showRestaurants():
restaurants = session.query(Restaurant)
return render_template('restaurant.html',restaurants=restaurants)
Returns the same result as this function
def showRestaurants():
restaurants = session.query(Restaurant).all()
return render_template('restaurant.html',restaurants=restaurants)
For this restaurant.html file
<html>
<body>
<h1> Restaurants </h1>
{% for x in restaurants %}
</br>
{% endfor %}
</body>
</html>