Alexander,

Thank you a bunch for your reply (again).
My problem is slightly different, and I think I have solved it as
follows. The problem is the difference between these two conditions. I
need to use them both, but separately as my code below shows.

if prevplace_id is None and nextplace_id is None:
if prevplace_id == '' and nextplace_id == '':

And btw, I finally took the step of adding a dummy application on my
development system which I named "test" that can use be used to test
this sort of question that has both python and html, because I could
not think of a way to make the gae interactive console handle such
situations.

**********main.py code below***********
import os
from os import environ
import logging
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template

class MainPage(webapp.RequestHandler):
   def get(self):
       nextplace_id = self.request.get("nextplace", None)
       prevplace_id = self.request.get("prevplace", None)
       if prevplace_id is None and nextplace_id is None:
            path = os.path.join(os.path.dirname(__file__),
'input.html')
            template_values = {
                'msg': 'None and None',
                }
            self.response.out.write(template.render(path,
template_values))
       else:
         if prevplace_id == '' and nextplace_id == '':
            logging.info("nextplace_id: %s"%nextplace_id)
            logging.info("prevplace_id: %s"%prevplace_id)
            path = os.path.join(os.path.dirname(__file__),
'input.html')
            template_values = {
                'msg': 'Still, None and None',
                }
            self.response.out.write(template.render(path,
template_values))
         else:
             if nextplace_id is None :
                #
                logging.info("if nextplace_id: %s"%nextplace_id)
                logging.info("if prevplace_id: %s"%prevplace_id)
             else:
                #
                logging.info("else nextplace_id: %s"%nextplace_id)
                logging.info("else prevplace_id: %s"%prevplace_id)


application = webapp.WSGIApplication(
                                     [('/', MainPage),
                                      ],
                                     debug=True)


def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()
********** main.py  code above***********

**********input.html   code below***********
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<form method="get" action="/">
  <input type="text" name="nextplace"  value=""/>
  <!--input type="text" name="nextplace" /-->
   Next place (only Next or Prev, not both)
   <br />
  <input type="text" name="prevplace"  value=""/>
  <!--input type="text" name="prevplace" /-->
   Prev place (only Next or Prev, not both)
 <br />
   <input type="submit" value="Submit" />
</form>
 <br />
  {{msg}}
</html>
********** input. html   code above***********

**********app.yaml    code below***********
application: test
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
  script: main.py
********** app.yaml   code above***********


Brian in Atlanta
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to