It's possible to define new SQL functions for SQLite in Python. How can I do this in Django so that the functions are available everywhere?
An example use case is a query which uses the GREATEST() and LEAST() PostgreSQL functions, which are not available in SQLite. My test suite runs this query, and I'd like to be able to use SQLite as the database backend when running tests.