displaying manytomany fields in template

16 views
Skip to first unread message

splucena

unread,
Jan 21, 2014, 1:34:00 AM1/21/14
to django...@googlegroups.com


Template:
  
 {% for per in person_list%}
    <tr>
    <td>{{ per }}</td>
    {% for spec in per.specialization_id.all %}
        <td>{{ spec }}</td>
    {% endfor %}
    </tr>
    {% endfor %}

Here's my code in the template. I'ts not doing what I intend to see.

The table looks like this:

FullName | Programming | Web Design

How can I make it look like this instead

FullName | Programming, Web Design |

Jonathan Pentecost

unread,
Jan 21, 2014, 3:27:57 PM1/21/14
to django...@googlegroups.com
You will need to provide the Person model to decipher what is going on in your template. 
Reply all
Reply to author
Forward
0 new messages