-
-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates #904
Comments
Tracking ticket: #1023 |
Here's the current implementation of datasette/datasette/views/base.py Lines 102 to 108 in 8f97b9b
|
I think this should be a family of functions:
I also need a way for plugins to link to e.g. |
Could have |
Alternatively, I could expose a single object that knows how to construct all kinds of URLs. Something like this:
|
If I do these methods I think this should be available on the |
Related: #1026 (How should datasette.client interact with base_url) Also this comment from #943 (comment)
|
Options:
|
I quite like |
OK, I'm committing to |
I tried using this block of template in a plugin and got an error:
Error:
'database_url' is undefined
That's because
database_url
is only made available by the BaseView template here:datasette/datasette/views/base.py
Lines 110 to 125 in d6e03b0
The text was updated successfully, but these errors were encountered: