[PYTHON] Throw GQL with a numeric ID from the App Engine management screen

gql.jpg

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

Throw GQL with a numeric ID from the App Engine management screen
DJango memo: From the beginning (editing the management screen) There is a mystery
Create a Todo app with the Django REST framework
Transit to the update screen with the Django a tag
Get the id of a GPU with low memory usage
Log in to the fortigate (6.0) management screen from selenium-try to log out
Access the file with a relative path from the execution script.
Build a bulletin board app from scratch with Django. (Part 2)
Build a bulletin board app from scratch with Django. (Part 3)
DJango Memo: From the beginning (more edits to the management screen)
DJango memo: From the beginning (using the management screen) my addictive point
Read a file in Python with a relative path from the program
Building a development environment with Maven on Google App Engine [Java]
Operate Firefox with Selenium from python and save the screen capture