Check this out
{% if protocol == 'Add-Item='|concat:room.id %}
{% include "supplies/item-form.html" %}
{% endif %}
the include
block never executes even when 'Add-Item='|concat:room.id
is exactly the output of {{ protocol }}
. It then implies that the protocol
variable in the if
block condition is an object
and not the output of protocol.__str__()
Is this the design because this almost drove me crazy for three days? I had to implement a protocol
property to achieve the desired output.
example cmd
property in protocol below outputs a string:
{% if protocol.cmd == 'Add-Item='|concat:room.id %}
{% include "supplies/item-form.html" %}
{% endif %}