steveire / grantlee

Libraries for text templating with Qt
Other
141 stars 50 forks source link

Relating two integers with an if-statement #52

Closed dagostinelli closed 5 years ago

dagostinelli commented 5 years ago

I'm using TexturePacker which uses Grantlee templates internally. I'm having an elementary problem. Making an if-statement work. I actually can't find a single case in Grantlee or in Texture packer where there is an example relating two numbers. So here goes:

Doesn't work {% if 8 > 7 %}bigger{% endif %}

Doesn't work {% if 7 == 8 %}not equal{% endif %}

Works {% if myobject.is_true %}yes{% endif %}

I'm trying to decide if this is a TexturePacker bug or a Grantlee bug. Since I haven't seen this in any Grantlee documentation, I decided to start here.

steveire commented 5 years ago

Grantlee 5.1 gained support for the "Django smart if tag". I don't know which version of grantlee TexturePacker ships. I recommend checking if it is at least that version. (if not, and you're feeling adventurous you can try replacing the grantlee binaries they ship).