I see the document 
https://developers.google.com/appengine/docs/python/ndb/keyclass#Key_integer_id

Returns the integer id in the last (kind, id) pair, or None if the key has 
an string id or is incomplete.

see I think the id of a key can be a int ; so I write

    r = ndb.Key(UserSession, int(id)).get()
    if r:
        return r.session

but the dev_server.py , will always raise

  File 
"/home/bitcoin/down/google_appengine/google/appengine/datastore/datastore_stub_util.py",
 line 346, in CheckReference
    raise datastore_errors.BadRequestError('missing key id/name')
BadRequestError: missing key id/name

I chanage the int(id) -> str(id)

seems right ;

so my question is , How to use ndb key with integer_id ?

the model is

class UserSession(ndb.Model):
    session = ndb.BlobProperty()


(always asked in 
http://stackoverflow.com/questions/15187813/how-to-use-ndb-key-with-integer-id 
, but no answer ...)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to