from google.appengine.ext import db
from datetime import date
class Test(db.Model):
title=db.StringProperty(required=True)
tags=db.StringListProperty(required=True)
a print on the Test type of object shows
Test(key_id=1, title='ashu_saved', tags=['db'])
but the key_id attribute is is not accesible by title.key_id
.also test.pk
returns u'agRibG9nchILEgxhc2lzYWlkX3Rlc3QYAQw'
is there a way to obtain nicely looking integer primary keys that i can use in the urls, from the model objects in google-appengine?
Try with:
yourkey = test.key().id()
and to get your value back:
Test.get_by_id(ids = yourkey)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With