Hi,
I have several character fields with leading and trailing spaces and would like to know if it is possible to clean them up with a one-liner...
I tried the following but none of this works:
rooms.objects.all().update(name=F('name').strip()) // AttributeError: 'F' object has no attribute 'strip'
rooms.objects.all().update(name=Value(F('name')).strip()) // AttributeError: 'Value' object has no attribute 'strip'
rooms.objects.all().update(name=name.strip()) // NameError: name 'name' is not defined
Also searching via Google did not help.
Of course I could do some loop, but this seems to be not very efficient to me.
Any Idea?
Thomas