样本模式:
class Foo(db.Model):
id = db.IntegerProperty()
bar = db.ListProperty(int, required=True)
如何利用Query或Gql Query归还所有具有一定价值的
实体<>bar? 如果我有一份女方名单,则有一个单一的过滤器,将收复所有有<>strong>id的实体。 财产被列入该清单?
样本模式:
class Foo(db.Model):
id = db.IntegerProperty()
bar = db.ListProperty(int, required=True)
如何利用Query或Gql Query归还所有具有一定价值的
如果我有一份女方名单,则有一个单一的过滤器,将收复所有有<>strong>id的实体。 财产被列入该清单?
1. 导言
如果您在一份清单中采用平等查询方法,它将检查清单上的所有物品:
search = 2
results = Foo.all().filter( bar = , search).fetch()
2. 结 论
您可以使用国家清单过滤器,但指出,在内部,该清单对清单中的每一项目都进行了数据储存查询,因此可能很缓慢,而且每次请求中最多还有30个内部查询。
items = [1, 2, 3]
results = Foo.all().filter("id IN", items).fetch()
See Introducing Queries for details for both 1 and 2, and
对像我这样的人来说,他们无法得到上述工作答案。
采用1.05版
results = Foo.all().filter( bar = , search).fetch()
没有结果。 但
results = Foo.all().filter( bar = , search).fetch(100)
results = Foo.all().filter( bar = , search)
结果。
此外,你还可以使用Gql,这或许是自问问题以来发生的发展。
问题1
wheres = 2
pageSize = 10
qry = db.GqlQuery("SELECT * FROM Foo WHERE bar = :1", wheres)
Foos = qry.fetch(pageSize)
问题2
wheres = [ 1, 3, 44, 101 ]
pagesize = 10
qry = db.GqlQuery("SELECT * FROM Foo WHERE bar IN (:1)", wheres)
Foos = qry.Fetch(pageSize)
但是,对 que子进行观察。 它实际上将执行国家分局(其中每个要素有一个)。 这里有Gql文件:。
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 ...
Background I used to have a standard Linux hosting account for my domain with both http://www.tjrobinson.net/ and http://tjrobinson.net/ displaying the same content. I used http://tjrobinson.net/ as ...
I am trying to use openid/hybrid in app engine, but so far, no luck. No success with openid4java (because it creates socket etc), and no luck with dyuproject either. How do it deploy dyuproject into ...
How do I make a temporary backup of the local datastore in the AppEngine SDK for MacOSX And where are the files located?
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") ...
I m trying to deploy a java application to appspot (google appengine). I m new to java, so bear with me. When I run the application locally from eclipse, it runs fine. After uploading it to google ...
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 ...
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 ...