Elsewhere
Release TIL Research Tool Museum
Filters: Sorted by date
3,015 results
«« first
« previous
page 68 / 101
next »
last »»
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).
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.
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:
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.
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.
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.
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:
«« first
« previous
page 68 / 101
next »
last »»