Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Upgrade Datasette #6

Merged
merged 6 commits into from
Apr 17, 2018
Merged

Upgrade Datasette #6

merged 6 commits into from
Apr 17, 2018

Conversation

earthboundkid
Copy link
Contributor

@earthboundkid earthboundkid commented Apr 15, 2018

Adds sorting by columns.

2018-04-14 9 23 40

@earthboundkid earthboundkid requested a review from carolinp April 15, 2018 01:18
@@ -13,7 +13,7 @@
<form class="sql" action="/{{ database }}-{{ database_hash }}" method="get">
<h3>Custom SQL query</h3>
<p>Note: Database uses <a href="https://www.sqlite.org/lang.html">SQLite</a> syntax.</p>
<p><textarea name="sql">select * from {{ tables[0].name|escape_table_name }}</textarea></p>
<p><textarea name="sql">select * from {{ tables[0].name|escape_sqlite }}</textarea></p>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

escape_table_name was removed and replaced in the new Datasette.

{% else %}
<a href="{{ path_with_added_args(request, {'_sort': column.name, '_sort_desc': None, '_next': None}) }}" rel="nofollow">{{ name }}{% if column.name == sort_desc %}&nbsp;▲{% endif %}</a>
{% endif %}
{% endif %}
Copy link
Contributor Author

@earthboundkid earthboundkid Apr 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this is copy-pasta from Datasette's new default template.


{% include "_codemirror_foot.html" %}
{% include "_codemirror_foot.html" %}
{% endif %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error handling was changed in the new Datasette.

@earthboundkid
Copy link
Contributor Author

I found a bug with sorting NULL columns. It's reported here: simonw/datasette#216

We should probably wait until that's worked out before upgrading.

@simonw
Copy link

simonw commented Apr 17, 2018

I just shipped Datasette 0.19 with a fix for simonw/datasette#216

@earthboundkid
Copy link
Contributor Author

Thanks, Simon!

@earthboundkid earthboundkid merged commit 0c07ef6 into master Apr 17, 2018
@earthboundkid earthboundkid deleted the cj/upgrade-datasette branch April 17, 2018 15:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants