I'm trying to simulate this stringformat "% s03d"% (name.upper (), number), in a Django query. It is not as easy as doing the field query in the model because it is not stored in the database.
DummyModel.objects.all().annotate(
format_str=Concat(Upper(F('name')), F('number'), output_field=CharField())
)
But this is not really what I need, because format_str does not contain the zeros further to the left in F ('number').