title: Having trouble getting Django {% regroup %} to work
body: <p>I am trying to work with the <code>{% regroup %}</code> template tag to display user made lists with items in them to look like this:</p>
  <blockquote>
  <p>LIST NAME</p>
  <p>Item</p>
  <p>Item</p>
  <p>Item</p>
  </blockquote>
  <p>Not this (which is the only way I can get it to render atm):</p>
  <blockquote>
  <p>List Name 1</p>
  <p>Item 1</p>
  <p>List Name 1</p>
  <p>Item 2</p>
  <p>List Name 1</p>
  <p>Item 3</p>
  </blockquote>
  <p>Based on my reading of the Django Docs I have to turn my queryset into a dictionary but I am having trouble achieving this. I also need to ensure my queryset if filtered based on the logged in user. I am getting errors depending on where I put the values() method, or it currently shows nothing at all...</p>
  <p>I also tried following this answer but got no love.<a href="https://stackoverflow.com/questions/3865265/django-regroup-not-working-as-expected">enter link description here</a></p>
  <p>Here is my views.py</p>
  <pre><code>class user_playlist(ListView):
      template_name = 'testingland/playlist.html'
      context_object_name = 'playlist'
      model = UserVenue
  
      def get_queryset(self):
          venue = self.request.GET.get('venue', None)
          list = self.request.GET.get('list', None)
          playlist = UserVenue.objects.filter(list__user=self.request.user)
          return playlist
  </code></pre>
  <p>Here is the models:</p>
  <pre><code>class UserList(models.Model):
      list_name = models.CharField(max_length=255)
      user = models.ForeignKey(User, on_delete=models.CASCADE) #is this okay?
  
      def __str__(self):
          return self.list_name
  
  class UserVenue(models.Model):
      venue = models.ForeignKey(mapCafes, on_delete=models.PROTECT)
      list = models.ForeignKey(UserList, on_delete=models.PROTECT)
  </code></pre>
  <p>And here is the template (I built it based on reading the Django Docs on <a href="https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#regroup" rel="nofollow noreferrer">regroup</a>).</p>
  <pre><code>&lt;div class=&quot;user_playlists&quot;&gt;
  {% regroup venue by list as user_playlist %}
    &lt;ul&gt;
        {% for list in user_playlist %}
        &lt;li&gt; {{ list.grouper }}
          &lt;ul&gt;
              {% for place in list.list %}
              &lt;li&gt;{{ place.venue }}&lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;
        &lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>