title: How to access an array index by its value in a Django Template?
body: <p>I have an step array and a method to access in which step the process is. This method returns the process name. I need to get the position of the array where the value is equal to the step I am at.</p>
  
  <p>Example:</p>
  
  <p>Models</p>
  
  <pre><code># models.py
  
  steps = ['passo_open','passo_edit','passo_add_file','passo_judge']
  
  step = process.get_current_step()
  
  print step 
  #prints 'passo_edit'
  </code></pre>
  
  <p>Template</p>
  
  <pre><code># mytemplate.html
  
  {{ step }}
  # prints 'passo_edit'
  
  {{ steps }}
  # prints ['passo_open','passo_edit','passo_add_file','passo_judge']
  </code></pre>
  
  <p>What I need is to get 1 instead:</p>
  
  <pre><code>myStep = 1
  </code></pre>
  
  <p>I know I can get the step by index, for example:</p>
  
  <pre><code>{{ steps.3 }} ## prints 'passo_judge'
  </code></pre>
  
  <p>What I need is:</p>
  
  <pre><code>    # value = how_to_get_index(steps,step)
      # print value
      # prints 3 
  </code></pre>
  
  <p>I have a bunch of links for the steps but I have to print only if it's lower than the next_step. That's why I have to get the number so I can print the links in the template until <strong>myStep</strong>. How can I get the index of the array by its value inside the Django Template?</p>