1👍
using Coalesce
from django.db.models.functions
solved my issue
SomeModel.objects.filter(
some_filters
).annotate(
var=ExpressionWrapper(
F('val') + Coalesce(F('table2__val'), 0), output_field=FloatField()
)
)
Source:stackexchange.com