We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this not working any more ?
>>> q = (db.person.id == 1) >>> db(q.as_dict(flat=True)).select() File "<string>", line unknown SyntaxError: Operator not supported: eq
That is in a web2py shell, I mean is the same thing passing around the query in the session as a dict, is not ?
The text was updated successfully, but these errors were encountered:
Looking at the code in
pydal/pydal/objects.py
Line 2169 in dfc507e
It seems that the value of op is expected to be uppercase, however:
op
>>> from pydal import DAL, Field >>> db = DAL('sqlite://storage.db') >>> db.define_table('thing',Field('name')) <Table thing (id, name)> >>> db.thing.insert(name='Chair') 1L >>> query = db.thing.id > 0 >>> query.as_dict(flat=True) {'second': 0, 'ignore_common_filters': False, 'optional_args': {}, 'first': {'fieldname': 'id', 'tablename': 'thing'}, 'op': 'gt'} >>> db(query.as_dict(flat=True)).select(db.thing.ALL) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pydal/base.py", line 691, in __call__ return self.where(query, ignore_common_filters) File "pydal/base.py", line 702, in where return Set(self, query, ignore_common_filters=ignore_common_filters) File "pydal/objects.py", line 2096, in __init__ query = self.parse(query) File "pydal/objects.py", line 2167, in parse return self.build(self.dquery) File "pydal/objects.py", line 2228, in build raise SyntaxError("Operator not supported: %s" % op) SyntaxError: Operator not supported: gt
You can see that query.as_dict() returns the value of op as lowercase.
query.as_dict()
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Is this not working any more ?
That is in a web2py shell, I mean is the same thing passing around the query in the session as a dict, is not ?
The text was updated successfully, but these errors were encountered: