From 4002e9337aae918b129a7a33c5166988ff8c39ca Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 9 Feb 2017 12:19:54 -0800 Subject: [PATCH] Fix cloudsql sample ordering (#792) --- appengine/flexible/cloudsql/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appengine/flexible/cloudsql/main.py b/appengine/flexible/cloudsql/main.py index 4512e59bf9ab..b64c3f08cde1 100644 --- a/appengine/flexible/cloudsql/main.py +++ b/appengine/flexible/cloudsql/main.py @@ -19,6 +19,7 @@ from flask import Flask, request from flask_sqlalchemy import SQLAlchemy +import sqlalchemy app = Flask(__name__) @@ -69,7 +70,7 @@ def index(): db.session.add(visit) db.session.commit() - visits = Visit.query.order_by(-Visit.timestamp).limit(10) + visits = Visit.query.order_by(sqlalchemy.desc(Visit.timestamp)).limit(10) results = [ 'Time: {} Addr: {}'.format(x.timestamp, x.user_ip)