You aren't using Value correctly -- it's not for wrapping raw SQL.
https://docs.djangoproject.com/en/dev/ref/models/expressions/#value-expressions
What I was trying to suggest is that you write your own expression class
that generates the FIELD(...) SQL.
https://docs.djangoproject.com/en/dev/ref
In my original ticket (https://code.djangoproject.com/ticket/28756) I
explained this:
I have reoccurring situation, when in a view.py function I need a queryset
ordered by a set of identifiers. The order of those identifiers is
dependent on factors outside of my control. Essentially in my view
2 matches
Mail list logo