Commits

Anonymous committed 9fdaaf4

倒序排列

Comments (0)

Files changed (2)

     default_values = {'author':u'wayhome','created':datetime.datetime.utcnow,}
     use_dot_notation = True
 
-#connection.register([Entry,Log])
-connection.register([Entry])
-connection.register([Log])
+connection.register([Entry,Log])
 
 @app.route('/')
 def show_entries():
-    entries = connection.flaskkit.entries.find()
+    entries = connection.flaskkit.entries.find().sort('created',-1)
     return render_template('show_entries.html', entries=entries)
 
 @app.route('/add', methods=['POST'])