You can't do that because a new instance of DirectoryHandler is created for each request, so get() and post() don't run in the same request (unless you explicitly do so). The only way is to preserve the variable between requests somehow, probably by passing it as a form parameter.
Robert On Sat, Jan 22, 2011 at 22:03, Zeynel <[email protected]> wrote: > class DirectoryHandler(webapp.RequestHandler): > def get(self): > .... > merchandise_type = self.request.get("type", "") > .... > def post(self): > .... > item.type = merchandise_type > #gives name not defined error > .... > > Is there a way to use this merchandise_type variable in the same > handler? > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > 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. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. 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.
