from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.ext import db from itertools import * class Accounts(db.Model): age = db.IntegerProperty(required=True) name = db.StringProperty(required=True) class MainHandler(webapp.RequestHandler): def get(self): nams=["Spike Spigel","Jet Black","Faye Valentine"] for i in range(10): Accounts(age=i%4,name=nams[i%3]).put() a1 = Accounts.all().filter("name =", "Spike Spigel").filter("age >=", 2) a2 = Accounts.all().filter("name =", "Jet Black").filter("age >=", 3) a3 = Accounts.all().filter("name =", "Faye Valentine").filter("age ==", 2) ac = chain(a1,a2,a3) for a in ac: self.response.out.write(a.name+" age"+str(a.age)) self.response.out.write("
") table ="" for a in Accounts.all(): table += "" table +="
nameage
" +a.name + ""+ str(a.age)+"
" self.response.out.write(table) def main(): application = webapp.WSGIApplication([('/', MainHandler)], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main()