You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a very complex Query and want to use SQL('*') to select all fields to avoid specifying all fields and making the query even longer.
Very basic example:
from peewee import SqliteDatabase, PrimaryKeyField, CharField, Model, SQL, fn
db = SqliteDatabase(':memory:')
class Model1(Model):
id = PrimaryKeyField()
column = CharField()
class Meta(object):
database = db
Model1.create_table()
Model1.create(id=1, column='bar')
Model1.create(id=2, column='foo')
Model1.create(id=3, column='baz')
res = Model1.select(SQL("*"))
print res
for a in res:
print a
which results in the following error:
<class '__main__.Model1'> SELECT * FROM "model1" AS t1 []
File "<path>/tests/bla.py", line 30, in <module>
for a in res:
File "<path>/env_local/local/lib/python2.7/site-packages/peewee.py", line 1615, in next
obj = self.iterate()
File "<path>/env_local/local/lib/python2.7/site-packages/peewee.py", line 1601, in iterate
self.initialize(self.cursor.description)
File "<path>/env_local/local/lib/python2.7/site-packages/peewee.py", line 1643, in initialize
select_column = self.column_meta[i]
IndexError: list index out of range
i'm using the current master.
Thanks
Goir
The text was updated successfully, but these errors were encountered:
Hi,
I have a very complex Query and want to use SQL('*') to select all fields to avoid specifying all fields and making the query even longer.
Very basic example:
which results in the following error:
i'm using the current master.
Thanks
Goir
The text was updated successfully, but these errors were encountered: