You can use QuerySet.order_by for this purpose. Something along these lines should work
from django.db.models.lookups import Exact
Books.objects.order_by(
Exact(F("pk"), favourite)).desc()
)
Which should result in the following SQL
SELECT *
FROM book
ORDER BY (pk = 12) DESC