Simon Willison’s Weblog

Newsletter
Atom feed

Elsewhere

Filters: Sorted by date

None
TIL Django Admin action for exporting selected rows as CSV — I wanted to add an action option to the Django Admin for exporting the currently selected set of rows (or every row in the table) as a CSV file.
Release django-sql-dashboard 0.10a1 — Django app for building dashboards using raw SQL queries
Release django-sql-dashboard 0.10a0 — Django app for building dashboards using raw SQL queries
Sighting 12:07 PM — Leopard Shark, in Pillar Point Harbor, CA, US
Leopard Shark
Leopard Shark
Leopard Shark
Leopard Shark
Release django-sql-dashboard 0.9a1 — Django app for building dashboards using raw SQL queries
Release django-sql-dashboard 0.9a0 — Django app for building dashboards using raw SQL queries
None
TIL Constructing GeoJSON in PostgreSQL — In order to efficiently generate a GeoJSON representation of a vast number of locations, I'm currently experimenting with generating the GeoJSON directly inside a PostgreSQL SQL query using `json_build_object()` and friends.
None
TIL Filter by comma-separated values in the Django admin — I have a text column which contains comma-separated values - inherited from an older database schema.
None
TIL Usable horizontal scrollbars in the Django admin for mouse users — I got a complaint from a Windows-with-mouse user of a Django admin project I'm working on: they couldn't see the right hand columns in a table without scrolling horizontally, but since the horizontal scrollbar was only available at the bottom of the page they had to scroll all the way to the bottom first in order to scroll sideways.
None
TIL Enabling the fuzzystrmatch extension in PostgreSQL with a Django migration — The PostgreSQL [fuzzystrmatch extension](https://www.postgresql.org/docs/13/fuzzystrmatch.html) enables several functions for fuzzy string matching: `soundex()`, `difference()`, `levenshtein()`, `levenshtein_less_equal()`, `metaphone()`, `dmetaphone()` and `dmetaphone_alt()`.
None
TIL Listing files uploaded to Cloud Build — Today while running `datasette publish cloudrun ...` I noticed the following:
Release django-sql-dashboard 0.8a2 — Django app for building dashboards using raw SQL queries
Release django-sql-dashboard 0.8a1 — Django app for building dashboards using raw SQL queries
Release django-sql-dashboard 0.8a0 — Django app for building dashboards using raw SQL queries
None
TIL Using json_extract_path in PostgreSQL — The `json_extract_path()` function in PostgreSQL can be used to extract specific items from JSON - but I couldn't find documentation for the path language it uses.
Release django-sql-dashboard 0.7a0 — Django app for building dashboards using raw SQL queries
Release json-post 0.2 — Tool for posting JSON to an API, broken into pages
Release json-post 0.2a0 — Tool for posting JSON to an API, broken into pages
None
TIL Using unnest() to use a comma-separated string as the input to an IN query — [django-sql-dashboard](https://github.com/simonw/django-sql-dashboard) lets you define a SQL query plus one or more text inputs that the user can provide in order to execute the query.
Release json-post 0.1a0 — Tool for posting JSON to an API, broken into pages
Release airtable-export 0.7.1 — Export Airtable data to YAML, JSON or SQLite files on disk
None
TIL Efficient bulk deletions in Django — I needed to bulk-delete a large number of objects today. Django deletions are relatively inefficient by default, because Django implements its own version of cascading deletions and fires signals for each deleted object.
Release django-sql-dashboard 0.6a0 — Django app for building dashboards using raw SQL queries
Release airtable-export 0.7 — Export Airtable data to YAML, JSON or SQLite files on disk
None
TIL Language-specific indentation settings in VS Code — When I'm working with Python I like four space indents, but for JavaScript or HTML I like two space indents.
None
TIL Useful Markdown extensions in Python — I wanted to render some markdown in Python but with the following extra features:
Release airtable-export 0.6 — Export Airtable data to YAML, JSON or SQLite files on disk
Release datasette 0.56 — An open source multi-tool for exploring and publishing data
Release datasette-publish-azure 0.1a0 — Publish Datasette instances to Azure Functions (in progress)
None
TIL Writing an Azure Function that serves all traffic to a subdomain — [Azure Functions](https://docs.microsoft.com/en-us/azure/azure-functions/) default to serving traffic from a path like `/api/FunctionName` - for example `https://your-subdomain.azurewebsites.net/api/MyFunction`.