English 中文(简体)
Appengine: db.Model.get_by_id (id) is not work
原标题:Appengine: db.Model.get_by_id(id) does not work

I have some Ice-entities in my datastore. When I run the following on the admin-webInterface

from google.appengine.ext import db

class Ice(db.Model):
    name = db.StringProperty()
    description = db.StringProperty(multiline=True)
    date = db.DateTimeProperty(auto_now_add=True)

for ice in Ice.all():
    print ice.key().id()
    print Ice.get_by_id(ice.key().id())

我总是得到:

4
None
5
None
6
None
7
None
8
None
9
None
10
None
11
None
12
None
13
None
14
None
15
None
16
None
17
None
18
None
19
None
20
None

为什么?

问题回答

如果您的<代码>,你会看到这种行为。 Ice实体是儿童实体。 荒唐的田地并非全球独一无二,对特定类型和母体而言是独一无二的。

页: 1 http://code.google.com/appengine/docs/python/datashop/modelclass.html#Model_get_by_key_name" rel=“nofollow”>Model.get_by_key_name ( 相反的?

最近,我也曾遇到过“从来”方法方面的问题。 我正在使用SDK 1.7.6。 问题在于,新的发展中国家——用户创建数据储存实体,其价值大于Javascript。 我可以通过使用先后顺序的身份证在你们的发展中环境中固定下来。

利用这一链接进一步解释

当我寻求解决问题时,我与关于失踪父母的所有反馈混为一谈。 我没有失去亲子关系,仍然得到——否则不工作! 我希望,这一答案能够拯救有相同问题的人们一段时间......





相关问题
How to make logging.debug work on Appengine?

I m having a tough time getting the logging on Appengine working. the statement import logging is flagged as an unrecognized import in my PyDev Appengine project. I suspected that this was just an ...

gqlQuery returns object, want list of keys

Is there a way to convert the GqlQuery object to an array of keys, or is there a way to force the query to return an array of keys? For example: items = db.GqlQuery("SELECT __key__ FROM Items") ...

Integrating Google AppEngine with a Thick Client

I want to make a multi-user client-server solution with Java Swing thick client as a front-end and Google AppEngine (Java one) as a back-end. The problem is that GAE provides only web-based forms for ...

sorl.thumbnail : thumbnail is not a valid tag library?

I am trying to install sorl.thumbnail but am getting the following error message: thumbnail is not a valid tag library: Could not load template library from django.templatetags.thumbnail, No module ...

热门标签