-
-
Notifications
You must be signed in to change notification settings - Fork 711
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
Add “updated” to metadata #111
Comments
Having this as a global option may not make sense when publishing multiple databases. We can revisit that when we implement per-database and per-table metadata. |
We have per-database and per-table metadata now. I think it's time to make this actually happen. |
I think I'll just call it "updated" to avoid the ugly underscore. |
This may be the feature that causes me to add dateutilas a dependency (so I can use dateutil.parser.parse) |
This is still a good idea. |
This is STILL a good idea. |
Still a good idea today too! Would be great for https://cdc-vaccination-history.datasette.io/ for example. |
I'm going to use https://github.com/dateutil/dateutil for this - it's been maintained constantly (by an evolving team of contributors) since 2003 and is a very trustworthy dependency. |
So this is a metadata key called Question: should I support just the date - I think so. I can easily imagine situations where the exact time of day that a change was made hasn't been recorded, but the overall date is known. But in that case, should the |
Side-note: Django 4.0 will switch from using If I need to handle timezones I'll use that, but I think I can get away without it? Django does this: https://github.com/django/django/blob/b0ed619303d2fb723330ca9efa3acf23d49f1d19/setup.cfg#L39-L43
|
The simplest possible version of this: it's always represented as a UTC ISO datetime, like this:
Later versions of Datasette could extend this to handle other timezones or support just the date (though that's a backwards incompatible change so probably better to decide on the date thing right now). |
The audiences I care about here are:
For producers I think there are going to be two categories. The first is users who run "publish" and want the site to reflect when they did so (probably using For humans... I'd like to be able to calculate a relative time (3 hours ago) in addition to showing the display time, because that helps avoid confusion over timezones. For machine consumers, it might be nice to offer the option of a calculated Unix timestamp-since-1970, since those can be easier to work with in some languages than running a full ISO date parser. |
rcaught/querydata.io@a661d43 I'm going to try and turn this into a proper plugin when I get the chance. |
To give an indication as to when the data was last updated.
This should be a field in the metadata that is then shown on the index page and in the footer, if it is set.
Also support setting it using an option to “datasette publish” and “datasette package” - which can either be a string or can be the magic string “today” to set it to today’s date:
The text was updated successfully, but these errors were encountered: