简体   繁体   English

Google App引擎-访问数据存储

[英]Google app engine - Accessing datastore

Hi i wonder if you could help provide some advice; 嗨,我想知道您是否可以提供一些建议?

I have a python script allows users to post messages to the google app engine datastore - which uses ajax to post a message to the app engine. 我有一个python脚本,允许用户将消息发布到google app引擎数据存储区-使用ajax将消息发布到app引擎。 What i am trying to achieve is to have - in javascript- check the latest message being posted. 我想达到的目的是-在javascript中-查看发布的最新消息。 I have looked at the GQL docs but cannot find out how to check for the latest post. 我看过GQL文档,但找不到如何检查最新帖子。

// if {{message.**LastPost**}} == "hello"
//do this....
//end if

The GQL query would simply be to order your data by the date ascending and then limit to 1. GQL查询仅是按日期升序排序数据,然后限制为1。

Example: 例:

SELECT * FROM messages ORDER BY date_submitted DESC LIMIT 1

See https://developers.google.com/appengine/docs/python/datastore/gqlreference for reference. 请参阅https://developers.google.com/appengine/docs/python/datastore/gqlreference以获取参考。

If all you want is the latest record of your messages object which contains the DB query you can simply use something like messages.get().message 如果您想要的只是包含数据库查询的message对象的最新记录,则可以简单地使用messages.get().message

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从javascript文件中的Google App Engine数据存储区访问数据 - Accessing data from Google App Engine datastore in a javascript file 使用JSON和JavaScript访问Google App Engine数据存储 - Accessing Google App Engine datastore using JSON and JavaScript 将Google App Engine数据存储区模型传递给j​​avascript代码 - Passing Google App Engine datastore models to javascript code Google App Engine数据存储区-将HTML中的键值传递给js函数 - Google App Engine Datastore - key value passing in HTML to js function 如何将数据从应用程序引擎保存到数据存储谷歌云 javascript - How to save data from app engine to datastore google cloud javascript 使用Google App Engine作为数据存储将javascript / angularjs null保存为python none - saving javascript/angularjs null as python none using google app engine as datastore 如何从Google App Engine数据存储中获取数据到客户端的Angular JS中? - How to get the data from google app engine datastore into angular js which at client side? 在jsp文件中的javascript中访问Google数据存储区 - Accessing Google datastore in javascript in jsp file 引导程序和Google App引擎 - bootstrap and google app engine Google App将数据存储区数据存储在静态文件中 - google app store datastore data in static file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM