Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Switch to using datasette.client #61

Closed
simonw opened this issue Oct 19, 2020 · 4 comments
Closed

Switch to using datasette.client #61

simonw opened this issue Oct 19, 2020 · 4 comments
Labels
blocked enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Oct 19, 2020

I already did this in dogsheep/dogsheep-beta#28 and it worked very well.

@simonw simonw added the enhancement New feature or request label Oct 19, 2020
@simonw
Copy link
Owner Author

simonw commented Oct 19, 2020

request = Request.fake(path_with_query_string)
view = TableView(DatasetteSpecialConfig(datasette))
data, _, _ = await view.data(
request, database=database_name, hash=None, table=table_name, _next=after
)
klass = table_classes[table_name]
data["rows"] = [klass.from_row(r) for r in data["rows"]]

@simonw
Copy link
Owner Author

simonw commented Oct 20, 2020

Here's the implementation from dogsheep-beta: dogsheep/dogsheep-beta@9a759e9

@simonw
Copy link
Owner Author

simonw commented Oct 20, 2020

This is made trickier because of the DatasetteSpecialConfig mechanism it uses to disable suggested facets:

class DatasetteSpecialConfig(wrapt.ObjectProxy):
def config(self, key):
if key == "suggest_facets":
return False
return self.__wrapped__.config(key)

So I think this is blocked on needing an alternative mechanism for skipping suggest_facets. That's probably going to come out of the work on ?_extra= in simonw/datasette#262

@simonw
Copy link
Owner Author

simonw commented Jun 6, 2021

Now that I've released Datasette 0.57 with the new ?_nofacet=1 and ?_nocount=1 options I can finish implementing this: https://docs.datasette.io/en/stable/changelog.html#v0-57

@simonw simonw closed this as completed in 289484d Jun 7, 2021
@simonw simonw mentioned this issue Jul 16, 2021
simonw added a commit that referenced this issue Jul 16, 2021
simonw added a commit that referenced this issue Jul 16, 2021
I was going to do this as a 1.4.1 dot-release, but since it bumps the minimum version of Datasette up to 0.57 installing this version could bump the underlying Datasette version significantly, so this needs to be a minor release, not a patch release.

Refs #61, #76
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
blocked enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant