Re: [google-appengine] Re: How to use the same variable in two handlers?

2011-01-23 Thread djidjadji
With what you want to do there IS NO difference in doing it in Django templates then in Mako templates. That will result in a hatred awards Mako too. 2011/1/23 Zeynel azeyn...@gmail.com: Unfortunately, I have an irrational hatred for Django templates so I am trying to do this with Mako

[google-appengine] Re: How to use the same variable in two handlers?

2011-01-23 Thread Zeynel
On Jan 23, 1:12 am, Robert Kluin robert.kl...@gmail.com wrote: If you're trying to do this using Mako templates, here is a fully functional 'demo' that you should be able to easily adapt to do exactly what you're asking about. Thanks! But I decided in principle not to use templates at this

[google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Zeynel
On Jan 22, 12:07 pm, djidjadji djidja...@gmail.com wrote: Make merchandise_type a hidden input field of the form generated by Directory() and get the value in the DirectorySubmitHandler(). Ok. I have the hidden field in the form in Directory like this: input type=hidden name=dir_type

Re: [google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread djidjadji
input type=hidden name=dir_type value=### instead of ### print the value of the variable merchandise_type 2011/1/22 Zeynel azeyn...@gmail.com: On Jan 22, 12:07 pm, djidjadji djidja...@gmail.com wrote: Make merchandise_type a hidden input field of the form generated by Directory() and get the

[google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Zeynel
On Jan 22, 12:53 pm, djidjadji djidja...@gmail.com wrote: input type=hidden name=dir_type value=### instead of ### print the value of the variable merchandise_type Thanks, but I don't understand. The value of the url parameter is given by self.request.get(type, ) I cannot put this value in

Re: [google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Robert Kluin
Hi Zeynel, You'll have to show us how you are rendering the form. If you're using template, just pass the value you get for type to your template and print the value, like djidjadji said. Robert On Sat, Jan 22, 2011 at 10:01, Zeynel azeyn...@gmail.com wrote: On Jan 22, 12:53 pm,

[google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Ernesto Karim Oltra
Hi, render is a common word meaning build the form. You are sending the user a page, with the form. How do you build that page or how do you print the HTML you've written? PD: Have you seen the Python tutorial? http://code.google.com/intl/en/appengine/docs/python/gettingstarted/ On 22 ene,

Re: [google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread djidjadji
urllib.urlencode() should be used to quote the parameter If Directory() is processed after DirectorySubmitHandler() you can NEVER get the merchandise_type variable. And it is possibly handled in another app instance. dir_type = merchandise_type # remove this line dir_type is never used in

[google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Zeynel
On Jan 22, 4:53 pm, djidjadji djidja...@gmail.com wrote: urllib.urlencode() should be used to quote the parameter import urllib self.redirect(/dir?%s % urllib.urlencode({ 'type' : self.request.get(dir_type) } ) Thanks. But obviously I am missing something here. The value of type in

Re: [google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread djidjadji
'type' is between quotes == a string. Has nothing to do with a variable or a function object. -- You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this

[google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Zeynel
On Jan 22, 8:02 pm, djidjadji djidja...@gmail.com wrote: 'type' is between quotes == a string. Has nothing to do with a variable or a function object. I understand this. If I use this solution the url is always /dir?type=type= type is not replaced with the merchandise_type. Maybe I am not

Re: [google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Robert Kluin
So, if you are getting 'type=' twice, did you think about trying: self.redirect(/dir?%s % urllib.urlencode({ type : self.request.get(dir_type) } )) On Sat, Jan 22, 2011 at 20:33, Zeynel azeyn...@gmail.com wrote: On Jan 22, 8:02 pm, djidjadji djidja...@gmail.com wrote: 'type' is between

[google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Zeynel
On Jan 22, 10:35 pm, Robert Kluin robert.kl...@gmail.com wrote: So, if you are getting 'type=' twice, did you think about trying:   self.redirect(/dir?%s % urllib.urlencode({ type : self.request.get(dir_type) } )) Yes, actually I thought about that but I did not try it because I did not get

Re: [google-appengine] Re: How to use the same variable in two handlers?

2011-01-22 Thread Robert Kluin
If you're trying to do this using Mako templates, here is a fully functional 'demo' that you should be able to easily adapt to do exactly what you're asking about. app.yaml handlers: - url: /makodemo.* script: makodemo.py login: admin makodemo.py --- #!/usr/bin/env python