开发者

google app engine OR filter

开发者 https://www.devze.com 2022-12-12 02:16 出处:网络
I want to do an OR filter within google app engine. For example: class MyModel(db.Model): name = db.StringPropery()

I want to do an OR filter within google app engine.

For example:

class MyModel(db.Model):
    name = db.StringPropery()
    description = db. StringPropery()

The following will return all "MyModel" instances with name = steve AND description = "some text"

results = MyModel.all().filter("name =", "steve").filter("description =","some text").fetch(10)

开发者_Go百科What syntax do I use to change this to an OR statement? Or do I need to do two queries and then merge them somehow?


I found another thread with some answers here: app-engine-datastore-does-not-support-operator-or

Not sure how to mark this as a duplicate. Sorry.

0

精彩评论

暂无评论...
验证码 换一张
取 消