python - Retrieving entity with OR keyword in Google Datastore -


class object(db.model):     title = db.stringproperty()     user = db.stringproperty()     tags = db.stringlistproperty() 

want implement query on object above product same result as:

select * object title = 'title name' or user = 'user name' 

google datastore query have been able implement seems handle

select * object title = 'title name' , user = 'user name' 

is there way can implement ?

ps: using python on google app engine

qry = object.query(ndb.or(object.title == 'title',                           object.user == 'user')) 

note, imply have corresponding index query within index.yaml:

- kind: object   properties:   - name: title     direction: asc   - name: user     direction: desc 

and last thing note, should not use kind "object". i'm assuming purely question.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -