title: Keeping track of variable values in django for loop and avoid duplicates
body: <p>I have got a for loops which has many same values for different objects. I am trying to keep track of only the unique values. </p>
  
  <pre><code>`{% with cla.lodge_name|stringformat:"s" as hotel_stayed %}
   {% if hotel_stayed not in unique_hotel_list %}&lt;!-- How to do this?? in django template --&gt;
      {% for lodge in lodges %}
      {% if lodge.lodge_name == hotel_stayed %}
          &lt;div&gt;....&lt;/div&gt;
         `
  </code></pre>
  
  <p>I am having problem in creating a list which can append values so that I can check if the new value is present already in the unique_hotel_list. I also tried making a dictionary with name as a key and value as count. If count is greater than 1 no need to proceed. Also looked into filter tags but could not be successful. </p>
  
  <p>Thank you very much for help!</p>