I was coding an app and found that 'query.filter' was failing to work
using query and GQL equivalent 'where' was not working either.

I created a simple app to check if this was true... code posted below
and I ask... how can this be broken?

--

import cgi
import os
import re
from google.appengine.ext.webapp import template
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
class TestData(db.Model):
  Alias = db.TextProperty()
  Content = db.TextProperty()
class CreateData(webapp.RequestHandler):
  def get(self):
    newTestData = TestData(
      Alias  =  'test1',
      Content  =  '<h1>Test 1 loaded</h1><div style="border: 1px solid
red;">Test 1 loaded</div>',
    )
    newTestData.put()
    newTestData = TestData(
      Alias  =  'test2',
      Content  =  '<h1>bluetemplate loaded</h1><div style="border: 1px
solid blue;">{{ content }}</div>'
    )
    newTestData.put()
    self.redirect('/')
class MainPage(webapp.RequestHandler):
  def get(self):
    query = db.Query(TestData)
    query = TestData.all()
    #query.filter('Alias = ', 'test1') # Uncomment this filter, and no
results match for 'test1' or 'test2'
    results = query.fetch(limit=1)
    #results = db.GqlQuery("SELECT * FROM TestData WHERE Alias = :1",
'test1') # Uncomment this to see GQL also fails...
    for result in results:
      output = result.Content
      self.response.out.write(output)
application = webapp.WSGIApplication(
  [
    ('/createdata', CreateData),
    ('/.*', MainPage),
  ],
  debug=True
  )
def main():
  run_wsgi_app(application)
if __name__ == "__main__":
  main()
--~--~---------~--~----~------------~-------~--~----~
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