When viewing the Google App Engine Datastore on the management screen,
entity.key.id()It is a method to throw GQL with a numerical ID like
----
When throwing from Python, you can easily get it by using ``` Model.get_by_id ()` ``.
Using a numerical ID on the management screen
```select * from hogemodel where id = 12345;```
Even if I try to do it like this, it doesn't work.
After searching for the correct GQL method, the following method seems to be correct.
```select * from hogemodel where __key__ = key('hogemodel', 12345)```
Since the property ___key___ is included in the KEY type,
It seems that it is necessary to search by aligning with the Key type even in GQL.
It's a little annoying to have to enter the Model name twice.
reference:
http://stackoverflow.com/questions/3869858/gql-query-with-numeric-id-in-datastore-viewer
Recommended Posts