I'm am moving to using ndb now that it's out of the experimental phase. There are a few things that I need to rethink and one thing I am having trouble with is grabbing a unique identifier for a model entity client side. I grab entities as follows and send them to client side
questions = Questions.query()
self.values_for_client()["questions"] = questions
Then client side I iterate through each entry and then I set up a link for further investigating the model entry.
{% for question in questions %}
<tr>
<td><a href = "/view_details/{{question.key}}">View</a></td>
</tr>
{% endfor %}
I used to get a unique identifier like asdfer234234=== but now I get something like Key('Questions',%203) from {{question.key}}. I would then capture this unique identifier and use it like
question_key = Key(str(cgi.escape(key)))
question = Questions.all().filter("__key__ =", question_key).get()
How can I replicate this behaviour with ndb?