Simon Willison’s Weblog

Subscribe
Atom feed

Elsewhere

Filters: Sorted by date

TIL Running Datasette on Replit — I figured out how to run Datasette on https://replit.com/
TIL migrations.RunSQL.noop for reversible SQL migrations — `migrations.RunSQL.noop` provides an easy way to create "reversible" Django SQL migrations, where the reverse operation does nothing (but keeps it possible to reverse back to a previous migration state without being blocked by an irreversible migration).
Release django-sql-dashboard 0.11a0 — Django app for building dashboards using raw SQL queries
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
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
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.
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.
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.
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()`.
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
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
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
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
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.
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

Beats

Years

Tags