Try myProject.*key*
On 27 July 2013 18:48, Hayato Hoshikawa hayato1...@gmail.com wrote:
Hi Team,
I would like to know how to show key name from datamodel.all() on Django
template.
Wrote below code but don't find how I can make key_name at the red line.
Please tell me how to make them well.
*main.py*
class myProject(db.Model):
title_en = db.StringProperty()
title_ja = db.StringProperty()
category = db.StringProperty()
class topPage(webapp.RequestHandler):
def get(self):
myProject_list = myProject.all()
template_values = {
'myProject_list': myProject_list
}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))
*index.html*
{% extends basic.html %}
{% block main %}
li class=nav-headerBuzz-Term in Japan/li
{% for myProject in myProject_list %}
lia href=/anime?key={{ myProject.*key_name* }}{{
myProject.title_en }}/a/li
{% endfor %}
{% endblock %}
Thanks,
Hayato
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.