http://code.google.com/appengine/docs/python/datastore/gqlreference.html

(emphasis added)

The left-hand side of a comparison is always a property name. The right-hand
side can be one of the following (as appropriate for the property's data
type):

   - a str literal, as a single-quoted string. Single-quote characters in
   the string must be escaped as ''. For example: 'Joe''s Diner'
   - an integer or floating point number literal. For example: 42.7
   - a Boolean literal, as TRUE or FALSE.
   - a datetime, date, or time literal, with either numeric values or a
   string representation, in the following forms:
      - *DATETIME(**year**, **month**, **day**, **hour**, **minute**, **
      second**)*
      - *DATETIME('**YYYY-MM-DD HH:MM:SS**')*
      - *DATE(**year**, **month**, **day**)*
      - *DATE('**YYYY-MM-DD**')*
      - *TIME(**hour**, **minute**, **second**)*
      - *TIME('**HH:MM:SS**')*
   - an entity key literal, with either a string-encoded key or a complete
   path of kinds and key names/IDs:
      - KEY('*encoded key*')
      - KEY(*kind*, *name/ID* [, *kind*, *name/ID*...])
   - a User object literal, with the user's email address:
   USER(*email-address*)
   - a GeoPt literal, with the latitude and longitude as floating point
   values:
   GEOPT(*lat*, *long*)
   - a bound parameter value. In the query string, positional parameters are
   referenced by number: title = :1 Keyword parameters are referenced by
   name: title = :mytitle


On Wed, Apr 8, 2009 at 10:50 AM, Eduardo Aguila <jamr...@gmail.com> wrote:

> I have a big problem with GQL
>
>     # tests = db.GqlQuery("SELECT * FROM Test WHERE web='
> http://locallocal.com'") # Work
>
> return results!!
>
> but if me search = in datetime, newer work, for example:
>
> # tests = db.GqlQuery("SELECT * FROM Test WHERE datetime='2009-04-08
> 08:38:14.430060'") # But this dont work <-- PROBLEM HERE
>  # tests = db.GqlQuery("SELECT * FROM Test WHERE datetime='2009-04-08
> 08:38:14'") # But this dont work <-- PROBLEM HERE
>
> return 0 result!!, but it's false!! becose exist!! (i can see for example
> in admin area in data viewer)
>
> Sorry for my bad english, plz some ideas, adjunt the little script
>
>
>
>
>
>
> #!/usr/bin/env python
> import urlparse
> import wsgiref.handlers
> from google.appengine.ext import db
> from google.appengine.ext import webapp
> from google.appengine.ext.webapp \
>   import template
>
> # Modelos
> class Test(db.Model):
>   ip = db.StringProperty(required=True)
>   web = db.LinkProperty(required=True)
>   datetime = db.DateTimeProperty(auto_now_add=True)
>
> class MyHandler(webapp.RequestHandler):
>   def get(self):
>
>
>
>     test = Test(
>       ip = self.request.remote_addr,
>       web = 'http://locallocal.com'
>     )
>     test.put()
>     tests = db.GqlQuery("SELECT * FROM Test'")
>     # tests = db.GqlQuery("SELECT * FROM Test WHERE web='
> http://locallocal.com'") # Work
>     # tests = db.GqlQuery("SELECT * FROM Test WHERE datetime='2009-04-08
> 08:38:14.430060'") # But this dont work <-- PROBLEM HERE
>     # tests = db.GqlQuery("SELECT * FROM Test WHERE datetime='2009-04-08
> 08:38:14'") # But this dont work <-- PROBLEM HERE
>     # datetime='2009-04-08 08:38:14.430060'' exist in my datastore
>     values = {
>       'tests': tests
>     }
>     self.response.out.write(
>       template.render('ttest.html',
>                        values))
>
>     ip = 0
>     values = { 'ip': ip }
>
> def main():
>   app = webapp.WSGIApplication([
>     (r'/ttest.py', MyHandler)], debug=True)
>   wsgiref.handlers.CGIHandler().run(app)
>
> if __name__ == "__main__":
>   main()
>
> --
> Saludos Cordiales
>
> Eduardo Águila
> Visitame http://eduardoaguila.com
>
> >
>


-- 

Alkis

--~--~---------~--~----~------------~-------~--~----~
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 group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to