I have been trying to use a template which prints out entity
values from my model QA and also a couple of values from its parent
environment's entity which has the model PQ. In particular, the code I have
supplied works as is, but it does not allow me to include values from s
such as s.name because s.name is not in qs. I have attempted to use the
commented out line, for example (# qs["name"] = s.name) but I get the error
"TypeError: 'Query' object does not support item assignment".
class MainPage(BaseHandler):
def get(self):
s = PQ()
s.name = "CCD1"
s.owner = user
s.put()
q = QA()
q.survey = s
q.question = "If we dress up?"
q.answers = [0, 0, 0]
q.seqnum = float(100)
q.put()
qs = QA.all()
# qs["name"] = s.name
self.render_template('index.html', {'qs': qs})
Can anyone suggest a way to accomplish this, please?
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/u7zM4OoFhkMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.