I have a proxy model which has to have some calculated (with query expressions) read-only fields. Annotating won't do, because I will later need to have field metadata to do filtering in my views.
So, is there a way to call a SQL function to get the value?
I am looking for something like a QuerySet.annotate
for fields, a Transform
or a custom field that would do this.
I found a way to do this by using the Col
Expression
and a custom field.