constant.rst 321B

123456789101112
  1. ``constant``
  2. ============
  3. ``constant`` checks if a variable has the exact same value as a constant. You
  4. can use either global constants or class constants:
  5. .. code-block:: jinja
  6. {% if post.status is constant('Post::PUBLISHED') %}
  7. the status attribute is exactly the same as Post::PUBLISHED
  8. {% endif %}