I have a Django model
that has a NumberVal
field which is models.FloatField()
.
Then I need to annotate the queryset
objects like so
.annotate(numberval_as_text=str(OuterRef("NumberVal")))
- the same value, but as a string except for the fact that this throws QuerySet.annotate() received non-expression(s): OuterRef(NumberVal)
error which is clearly right but it demonstrates the point.
I need this because this annotation is followed by an extensive second annotation where I need this numberval_as_text
in subquery filters.
Any hint would be appreciated.