Hello,
I have two questions about data bindings:
-
Can you have an if statement in the data binding, something like:
-
Can you use string formating:
Hello,
I have two questions about data bindings:
Can you have an if statement in the data binding, something like:
Can you use string formating:
Yes to both of these but use the single line version of the if statement ie:
self.item['carbohydrates'] if self.item['carbohydrates'] != -1 else "None listed"
You can also use f strings or any other python expression in data bindings.
Note that this may make writeback impossible.