[Fixed]-Django annotate() error AttributeError: 'CharField' object has no attribute 'resolve_expression'

31👍

You have a closing parenthesis in the wrong place. The output_field is an argument for Concat, not for annotate. It should be:

Project.objects.annotate(
    companyname=Concat('company__name', Value('ahoj'), output_field=CharField()),    
)

Leave a comment