Q:

Django many-to-many field in template and through

In my models there are some manytomany fields. I've been struggling to make them appear in the template. One is a regular ManyToMany field, the other one uses through. The problem is that the amount is not shown. I understand that currently the iteration is only defined for component in pcbuilds.components.all. How to manage the amount in there as well? 
models.py:
class Component(models.Model):
    name = models.CharField(max_length=100, unique=True,help_text='Component name')
    manufacturer = models.IntegerField(blank=True,null=True,choices=MANUFACTURERS)
    model = models.CharField(max_length=100,unique=True,blank=True,null=True, help_text='model')

class Tag(models.Model):
title = models.CharField(max_length=100,unique=True,blank=True,null=True, help_text='tagname')

class PCBuilds(models.Model):
    title = models.CharField(max_length=50, help_text='PC build title')
    components = models.ManyToManyField(Component,help_text='Pick your components from the list or create and add them.',through='Componentlist')
    subtitle = models.CharField(blank=True,max_length=80, help_text='Subtitle')

def __str__(self):
    return self.title

class Componentlist(models.Model):
    component = models.ForeignKey(Component, on_delete=models.CASCADE,related_name='components')
    pcbuild = models.ForeignKey(PCBuilds, on_delete=models.CASCADE,related_name='pcbuilds')
    amount = models.FloatField(null=True,help_text='amount')

template:
<div class="card-deck">
    {% for pcbuilds in object_list|slice:":3" %}
        <div class="card" style="width: 18rem;">
            <div class="card-header">
                <a href="{% url 'pcbuilds_detail' pcbuilds.pk %}">
                <span class="font-weight-bold">{{ pcbuilds.title }}</span></a> &middot;
                <span class="text-muted">{{ pcbuilds.subtitle }}</span>
            </div>
            <div class="card-body">
            <ul>
            {% for component in pcbuilds.components.all %}
                   <li>{{ component.name}}{{ component.manufacturer}}{{ component.model }}{{ componentlist.amount }}</li>
            {% endfor %}
            </ul>
            </div>
            <div class="card-footer text-center text-muted">
            {% for tag in recipe.tags.all %}
            Tags: {{ tag.title }}
            {% endfor %}
            </div>
        </div>

        <br />
{% endfor %}

A:

You don't define componentlist there, so the template will ignore it. Normally, you need to follow a relationship, as you did to get component in the first place. But this way there is no access to the through table, as you've already effectively gone past it to get the target table.
Instead you need to follow the relationship from pcbuild to the through table, and from there to the component:
 {% for componentlist in pcbuilds.pcbuilds.all %}
           <li>{{ componentlist.component.name}}{{ componentlist.component.manufacturer}}{{ componentlist.component.model }}{{ componentlist.amount }}</li>
  {% endfor %}

Note, your related names in that through table are strange, which is why I had to use that confusing pcbuilds.pcbuilds.all. The reverse relationship from pcbuild to componentlist should be componentlist_set, which is the default; there shouldn't be any reason to change that.

