Previously I was using db instead of ndb. Now I'm migrating my code. The db.model equivalent of
key = model_instance.key()
I presume you're referring to the NDB Cheat Sheet, more specifically to the 4th row in the Entities table:
key = model_instance.key() | key = model_instance.key # no () !!
The text is actually
# no () !!, meaning no parenthesis/not a function call. Which is correct in the context as that's the method of obtaining the entity's key, which is an attribute in
ndb, vs. a function call in
db. It doesn't mean "do not use".