Create data by combining query results in Django <p>I have a 1-n relation in my models, e.g., 1 classroom - n students. </p> <pre><code>Classroom 1 - Joe Classroom 1 - Tim Classroom 1 - Julia Classroom 2 - Bob Classroom 2 - Alice </code></pre> <p>In my view I want to show a row for each classroom and a comma separated list for the students:</p> <pre><code>Classroom1 | Joe, Tim, Julia Classroom2 | Bob, Alice </code></pre> <p>Right now, I find the records for each classroom and create the list of students and combine that to create a dictionary.</p> <p>Is there a more efficient way to create this data? Can I save the list of students with each Classroom?</p>