On Aug 6, 5:56 am, ryan <
ryanb+appeng...@google.com> wrote:
> hi vijayakumar!
>
> On Aug 5, 6:01 am, v4vijayakumar <
vijayakumar.subbu...@gmail.com>
> wrote:
>
> > I am getting some error when I do mode.put() from Idle. Anything I am
> > missing?
>
> if you want to use the app engine python libraries from outside the
> dev_appserver, you need to do a little extra setup. see this thread:
>
>
http://groups.google.com/group/google-appengine/browse_thread/thread/...
>
> > one more issue. GQL with 'and' just executed fine, but with 'or' it is failing.
>
> GQL doesn't have an OR operator. :P
thats not fair. :(
one more doubt. whats wrong with this code,
>>> class test(db.Model):
a = db.StringProperty(required=True, default='test1')
b = db.StringProperty(required=True, default='test2')
c = db.BooleanProperty(required=True, default=False)
>>> q = test.gql("where not c and :1 in [a, b]", 'blah')
>>> q = test.gql("where c=False and :1 in [a, b]", 'blah')
--
>>> class test(db.Model):
a = db.StringProperty(required=True, default='test1')
b = db.StringProperty(required=True, default='test2')
c = db.BooleanProperty(required=True, default=False)
>>> q = test.gql("where not c and :1 in [a, b]", 'blah')
Traceback (most recent call last):
File "<pyshell#38>", line 1, in <module>
q = test.gql("where not c and :1 in [a, b]", 'blah')
File "C:\appe\google\appengine\ext\db\__init__.py", line 887, in gql
*args, **kwds)
File "C:\appe\google\appengine\ext\db\__init__.py", line 1523, in
__init__
self._proto_query = gql.GQL(query_string, _app=app)
File "C:\appe\google\appengine\ext\gql\__init__.py", line 171, in
__init__
if not self.__Select():
File "C:\appe\google\appengine\ext\gql\__init__.py", line 560, in
__Select
return self.__From()
File "C:\appe\google\appengine\ext\gql\__init__.py", line 576, in
__From
return self.__Where()
File "C:\appe\google\appengine\ext\gql\__init__.py", line 591, in
__Where
return self.__FilterList()
File "C:\appe\google\appengine\ext\gql\__init__.py", line 604, in
__FilterList
self.__Error('Invalid WHERE Condition')
File "C:\appe\google\appengine\ext\gql\__init__.py", line 485, in
__Error
(error_message, self.__symbols[self.__next_symbol]))
BadQueryError: Parse Error: Invalid WHERE Condition at symbol c
>>> q = test.gql("where c=False and :1 in [a, b]", 'blah')
Traceback (most recent call last):
File "<pyshell#39>", line 1, in <module>
q = test.gql("where c=False and :1 in [a, b]", 'blah')
File "C:\appe\google\appengine\ext\db\__init__.py", line 887, in gql
*args, **kwds)
File "C:\appe\google\appengine\ext\db\__init__.py", line 1523, in
__init__
self._proto_query = gql.GQL(query_string, _app=app)
File "C:\appe\google\appengine\ext\gql\__init__.py", line 171, in
__init__
if not self.__Select():
File "C:\appe\google\appengine\ext\gql\__init__.py", line 560, in
__Select
return self.__From()
File "C:\appe\google\appengine\ext\gql\__init__.py", line 576, in
__From
return self.__Where()
File "C:\appe\google\appengine\ext\gql\__init__.py", line 591, in
__Where
return self.__FilterList()
File "C:\appe\google\appengine\ext\gql\__init__.py", line 619, in
__FilterList
return self.__FilterList()
File "C:\appe\google\appengine\ext\gql\__init__.py", line 598, in
__FilterList
self.__Error('Invalid WHERE Identifier')
File "C:\appe\google\appengine\ext\gql\__init__.py", line 485, in
__Error
(error_message, self.__symbols[self.__next_symbol]))
BadQueryError: Parse Error: Invalid WHERE Identifier at symbol :1