title: Django: setting multiple lists in a view for a template to iterate over
body: <p>I'm trying to create multiple context objects in a view so that I can iterate over them separately in the template and print them vertically as HTML lists. How can I achieve this? </p>
  
  <p>My code is something like this:</p>
  
  <p>views.py:</p>
  
  <pre><code>class MultiListView(ListView):
  
      template_name = os.path.join(APPNAME, "list.html")
      context_object_name = 'list1'
      context_object_name2 = 'list2'
      context_object_name3 = 'list3'
  
      def get_queryset(self):
  
          query_set = List.objects.all()
          return list(query_set) # Only sets the context_object_name var, not the rest
  </code></pre>
  
  <p>list.html:</p>
  
  <pre><code>{% if list1 %}
    &lt;ul&gt;
     {% for item in list1 %}
      &lt;li class="item-list"&gt;item.name&lt;/li&gt;
     {% endfor %}
    &lt;/ul&gt;
  {% endif %}
  
  {% if list2 %}
    &lt;ul&gt;
     {% for item in list2 %}
      &lt;li class="item-list"&gt;item.name&lt;/li&gt;
     {% endfor %}
    &lt;/ul&gt;
  {% endif %}
  {% if list3 %}
    &lt;ul&gt;
     {% for item in list3 %}
      &lt;li class="item-list"&gt;item.name&lt;/li&gt;
     {% endfor %}
    &lt;/ul&gt;
  {% endif %}
  </code></pre>
  
  <p>The important thing for me is that the lists are printed vertically, so each list is it's own column. I am aware that the  multiple <code>context_object_name</code>'s thing won't work, but I put it in there to demonstrate what I want.</p>