Skip to content

Commit

Permalink
Fix cloudsql sample ordering (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Wayne Parrott authored Feb 9, 2017
1 parent 7953f20 commit 4002e93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion appengine/flexible/cloudsql/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from flask import Flask, request
from flask_sqlalchemy import SQLAlchemy
import sqlalchemy


app = Flask(__name__)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4002e93

Please sign in to comment.