1👍
✅
According to the docs you have to use Q
objects when using complex conditions (just like you did in filter
). An example:
When(Q(name__startswith="John") | Q(name__startswith="Paul"), then='name')
Source:stackexchange.com