Kat*_*lon 2 google-app-engine python-2.7 google-cloud-endpoints endpoints-proto-datastore google-cloud-datastore
所以我偶然发现EndpointsModel了创建模型的方法.当我在网上看时,基本上没有关于它的教程.对于使用它的人来说,有什么好处?而不是ndb.Model我的意思.
编辑:
此外,我试图模仿代码什么是最好的授权方式,识别和存储有关用户的微妙信息?只是为了检查它,但我的日食红线:
from endpoints_proto_datastore.ndb import EndpointsModel
Run Code Online (Sandbox Code Playgroud)
Endpoints Proto Datastore API不是App Engine SDK的官方部分,而是我一直在研究的库.
据记载,我很高兴来到这里并回答大家的提问.事实证明,它EndpointsModel是一个子类ndb.Model,所以你正在充分利用这两个世界:
>>> from endpoints_proto_datastore.ndb import EndpointsModel
>>> from google.appengine.ext import ndb
>>> EndpointsModel.__bases__ == (ndb.Model,)
True
Run Code Online (Sandbox Code Playgroud)
如文档登录页面所述,优势在于库:
...允许现有的模型类与Google Cloud Endpoints一起使用.通过扩展
ndb.Model类和endpoints库提供的功能,此库允许您直接与API方法中的模型实体交互,而不是与ProtoRPC请求交互.
我们还讨论了使用该库的问题.在其中,我们明确提到您需要将endpoints_proto_datastore库添加到您的应用程序中.
$ cd path/to/your/application/code
$ wget https://endpoints-proto-datastore.googlecode.com/files/endpoints_proto_datastore.zip
$ unqip -q endpoints_proto_datastore.zip
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
945 次 |
| 最近记录: |