Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Python list to query Google App Engine datastore

I have created a form in my Google App Engine application for users to select items from a list, the specific details of which (ex. name, other properties) will then be pulled from a datastore table called Item and displayed in a table once the user submits the form.

I have a Python list that contains the keys for the entries selected, pulled from the form. I want to use this list to look-up entries in the datastore and return them in a way that I can pass to a Django template.

I have tried to follow advice on this forum to use GQL Queries, but all I get thus far are empty results, whether using fetch(), hardcoding the key values, trying to use some variation of WHERE Key IN :list or WHERE Key = :variable.

If you need code, let me know which parts would be helpful.

like image 530
Toby Avatar asked Jan 27 '26 16:01

Toby


1 Answers

db.get(list_of_keys)

http://code.google.com/appengine/docs/python/datastore/functions.html

like image 95
Drew Sears Avatar answered Jan 30 '26 06:01

Drew Sears



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!