mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Moved .execute() method from BaseView to Datasette class
Also introduced new Results() class with results.truncated, results.description, results.rows
This commit is contained in:
parent
28a52fcffb
commit
81df47e8d9
4 changed files with 105 additions and 90 deletions
|
|
@ -36,6 +36,19 @@ class InterruptedError(Exception):
|
|||
pass
|
||||
|
||||
|
||||
class Results:
|
||||
def __init__(self, rows, truncated, description):
|
||||
self.rows = rows
|
||||
self.truncated = truncated
|
||||
self.description = description
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.rows)
|
||||
|
||||
def __len__(self):
|
||||
return len(self.rows)
|
||||
|
||||
|
||||
def urlsafe_components(token):
|
||||
"Splits token on commas and URL decodes each component"
|
||||
return [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue