Messages.objects.annotate(new_field=Value(('a1' if F('id') in [1755, 1753] else 'a2'), output_field=CharField()))
from django.db.models import CharField, Value, Case, When
Messages.objects.annotate(
new_field=Case(
When(id__in=[1755, 1753], then=Value('a1')),
default=Value('a2'),
output_field=CharField()
)
)