I've tried your method but I'm still having an error.
In my template I'm bulding a link by the key:
<a href=\"/{{ elemento.key}}/modifica\"> Modifica/Commenti </a>
then:
def main():
application = webapp.WSGIApplication([
('/ristorante', RistoHandler),
(r'/(.*)/modifica', ModificaHandler),
('/.*', MainHandler)],
debug=True)
wsgiref.handlers.CGIHandler().run(application)
then:
class ModificaHandler(webapp.RequestHandler):
def get(self, domain):
appo = self.request.get('domain')
risto = RISTORANTI.get_by_key_name(appo)
self.response.out.write(template.render('risto.html',{ 'risto':risto}))
The error is:
Traceback (most recent call last):
File "C:\Program
Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line
634, in __call__
handler.get(*groups)
File "C:\Users\Massimiliano\Desktop\AppEngine
Application\Thepietronis\main.py", line 39, in get
risto = RISTORANTI.get_by_key_name(appo)
File "C:\Program
Files\Google\google_appengine\google\appengine\ext\db\__init__.py", line 1188,
in get_by_key_name
for name in key_names]
File "C:\Program
Files\Google\google_appengine\google\appengine\api\datastore_types.py", line
489, in from_path
ValidateString(id_or_name, 'name')
File "C:\Program
Files\Google\google_appengine\google\appengine\api\datastore_types.py", line
158, in ValidateString
raise exception('%s must not be empty.' % name)
BadValueError: name must not be empty.
--
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/-/9TP9L5N3hGAJ.
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.