Replace raw SQL by a F-expression.
We will probably never need to run the code on another DB than Sqlite, but it stills seems nicer than having the code be done in SQL directly.
I tested with the unit tests but also by comparing the result of calling ".query" on the queryset with the raw SQL query and it seems they use the same code.