Skip to content

Instantly share code, notes, and snippets.

@markuman
Created November 24, 2020 07:24
Show Gist options
  • Save markuman/a9e95682ff68f357e35572d19276890f to your computer and use it in GitHub Desktop.
Save markuman/a9e95682ff68f357e35572d19276890f to your computer and use it in GitHub Desktop.
>>> a = keys.select().where(keys.revoked == True)
>>> a
<peewee.ModelSelect object at 0x7f6215804f10>
>>> a.dicts()
<peewee.ModelSelect object at 0x7f62158a4fd0>
>>> a.dicts().get()
Traceback (most recent call last):
File "/home/m/.local/lib/python3.8/site-packages/peewee.py", line 6860, in get
return clone.execute(database)[0]
File "/home/m/.local/lib/python3.8/site-packages/peewee.py", line 4258, in __getitem__
return self.row_cache[item]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/m/.local/lib/python3.8/site-packages/peewee.py", line 6863, in get
raise self.model.DoesNotExist('%s instance matching query does '
lib.dbv2.KeysDoesNotExist: <Model: Keys> instance matching query does not exist:
SQL: SELECT `t1`.`id`, `t1`.`user`, `t1`.`pub_key`, `t1`.`signed`, `t1`.`expire`, `t1`.`revoked` FROM `keys` AS `t1` WHERE %s LIMIT %s OFFSET %s
Params: [False, 1, 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment