[Answered ]-Django Query Annotation Does Not Support math.tan() Calculation

1👍

Use the Tan database function

from django.db.models.functions import Tan

Flights.objects.annotate(
    altitude=ExpressionWrapper(expression=F('baseline') * Tan('angle'), output_field=models.FloatField())
)

Leave a comment