google-app-engine


Google App Engine: Entity ID not showing


I have this in the Google App Engine python code,
class ABC(db.Model):
StringA = db.StringProperty()
abcs = ABC.all()
template_values = {'abcs': abcs,}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))
and this in the index.html,
<script type="text/javascript">
{% for abc in abcs %}
var id = "{{ abc.ID }}"; // needed the entity ID, the abc.ID doesn't show??
{% endfor %}
</script>
What was the right keyword to use for the entity ID, the abc.ID??
Thanks in advance.
{{abc.key.id}}, assuming you're using Django templates. The ID isn't a property of the object, it's a part of the object's Key; in a Django template (which is what you're using if you're using google.appengine.ext.webapp.template), this is the equivalent to abc.key().id() in Python code.
Note that not all entities have an ID at all; they could have a key name instead if you've set one.

Related Links

Best way to initialize datastore w/ related entities
Google Identiy Toolkit Random OAuth Error
Maintaining separate environments with no downtime on update in app engine
managing app engine versions through API calls
Go GAE Using LoginURLFederated function returns API error 2 (user: NOT_ALLOWED)
Approaches for overcoming 10000 file limit on Google App Engine?
App Engine: Copy live Datastore to local dev Datastore (that still works)
All of my applications throw “deadline was exceeded”. GAE breakdown?
Splitting entities vs. using transactions
DataNucleus on AppEngine not returning any results
Is there API for setting TLS certificates for Google App Engine?
GAE printing same log statement multiple times
Adding multiple accounts for “You do not have permission to modify this app” error
Logs are Not Nested Under Requests in Flexible VM
How to create an equivalent of a background thread for an auto-scaling instance
Communication between modules locally

Categories

HOME
notepad++
localization
c++11
codenvy
dns
rdbms
static
toolbox
cublas
soa
pyqt4
google-admin-sdk
azure-container-service
angularfire2
pkcs#11
minecraft-forge
pega
favicon
selenium-ide
renjin
eip
articulate-storyline
systemtime
jquery-callback
itunes
surveymonkey
jackson-modules
inversion-of-control
datastax-enterprise-graph
bioinformatics
carrierwave
userdefaults
xbox
dumpbin
playstation-portable
card.io
biztalk-rule-engine
sendbird
browser-extension
batching
lubridate
getlasterror
reason
sim-card
gdata
verifiable-c
demo
setup.py
tasm
dbnull
install.packages
oracle-service-bus
hammer.js
pair-programming
colorbar
offline.js
google-photos
android-instrumentation
stripe-connect
burrows-wheeler-transform
uicolor
greatest-n-per-group
mapinfo
respondcms
jtwig
android-wake-lock
mediametadataretriever
project-organization
ascii-art
boomerang
page.js
binomial-theorem
cgi-bin
visual-sourcesafe-2005
branch-and-bound
git-ftp
variadic-templates
beatsmusic
psr-4
wcm
gii
jqmodal
parallel-testing
grails-domain-class
radiant
android-usb
embedded-fonts
c++builder-xe5
rolify
abstract-data-type
octal
mantle
android-loadermanager
onmousemove
web-farm
boost-signals
jdb
window-decoration
usertype
stress
apache-commons-dbutils
android-holo-everywhere
cgbitmapcontextcreate
uideviceorientation
django-piston
wcf-instancing
mathematical-notation
fault-tolerance
netbeans6.1

Resources

Encrypt Message