mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fixed error in RowView
This commit is contained in:
parent
25c241fa5a
commit
9e9e961390
1 changed files with 6 additions and 3 deletions
|
|
@ -285,13 +285,16 @@ class RowView(BaseView):
|
|||
pk_values = compound_pks_from_path(pk_path)
|
||||
pks = await self.pks_for_table(name, table)
|
||||
wheres = [
|
||||
'"{}"=?'.format(pk)
|
||||
for pk in pks
|
||||
'"{}"=:p{}'.format(pk, i)
|
||||
for i, pk in enumerate(pks)
|
||||
]
|
||||
sql = 'select * from "{}" where {}'.format(
|
||||
table, ' AND '.join(wheres)
|
||||
)
|
||||
rows = await self.execute(name, sql)
|
||||
params = {}
|
||||
for i, pk_value in enumerate(pk_values):
|
||||
params['p{}'.format(i)] = pk_value
|
||||
rows = await self.execute(name, sql, params)
|
||||
columns = [r[0] for r in rows.description]
|
||||
rows = list(rows)
|
||||
if not rows:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue