Skip to content
Snippets Groups Projects
  • alangrafu's avatar
    b47ddfd3
    Adding syntactic sugar to first values in array · b47ddfd3
    alangrafu authored
    When only the first value is needed (or expected) instead of iterating
    over the array, it is possible to access the values by adding "_first."
    before the variable name.
    
    Example: {{r.modelFile._first.varname.value}}
    
    Instead of
    
    {%for row in r.modelFile%}
    {%if forloop.first%}{{row.varname.value}}{%endif%}
    {%endfor%}
    b47ddfd3
    History
    Adding syntactic sugar to first values in array
    alangrafu authored
    When only the first value is needed (or expected) instead of iterating
    over the array, it is possible to access the values by adding "_first."
    before the variable name.
    
    Example: {{r.modelFile._first.varname.value}}
    
    Instead of
    
    {%for row in r.modelFile%}
    {%if forloop.first%}{{row.varname.value}}{%endif%}
    {%endfor%}