title: Django Rest Framework - M2M via through
body: <p>Im having trouble with retrieving all fields I need from serializer.
  Scenario:</p>
  
  <p>I have 2 tables: Item &amp; Warehouse. Those tables are connected via M2M relationship via through table called InventoryStatus. What I need is to get Item info with nested warehouse info + status field from InventoryStatus Table.
  <strong><em>The problem is, I cant get the "status" field....</em></strong></p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>class InventoryItem(models.Model):
      id  = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
      code = models.CharField(max_length=25, null=False, blank=True)
      orgid = models.ForeignKey('glonass.Company', null=True, related_name='inventory_items_company')
      title = models.CharField(max_length=150, null=False, blank=True)
      inventory = models.ManyToManyField('CompanyBranch', through='InventoryStatus', related_name='branch_iventoryStatus')
  
  class CompanyBranch(BaseDataDescTime, LocationInfo, PostInfo, PoboxInfo, ContactInfo):
      id  = models.UUIDField(primary_key=True, default=uuid.uuid4,
      orgid = models.ForeignKey('glonass.Company', null=True, related_name='branches')
      slug = models.SlugField(max_length=150, blank=True, null=False)
  
  class InventoryStatus(models.Model):
      id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
      inventoryitem = models.ForeignKey('InventoryItem', related_name='inventory_status_items', null=True)
      orgid = models.ForeignKey('Company', null=True, related_name='inventory_status_company')
      companybranch = models.ForeignKey('CompanyBranch', related_name='inventory_status_warehouses', null=True)
      status = models.DecimalField(max_digits=9, decimal_places=2, null=True, blank=True, default=0)
  </code></pre>
  
  <p><strong>Serializer:</strong></p>
  
  <pre><code>class InventoryStatusSerializer(serializers.HyperlinkedModelSerializer):
      class Meta:
          model = InventoryStatus
  
  class CompanyBranchSerializer(serializers.HyperlinkedModelSerializer):
      class Meta:
          model = CompanyBranch
  
  class InventoryItemSerializer(serializers.HyperlinkedModelSerializer):
      inventory = CompanyBranchSerializer(many=True)
  
      class Meta:
          model = InventoryItem
  </code></pre>
  
  <p><strong>Output Needed:</strong></p>
  
  <pre><code>[
      {
          'id': 'xxxxxxxxxxxxx',
          'title': 'Car',
          'inventory': [
              {
                  'id': 'yyyyyyyyyyy',
                  'title': 'warehouse 1',
                  'status': 50
              },
              {
                  'id': 'zzzzzzzzzzzz',
                  'title': 'warehouse 2',
                  'status': 10
              }
          ]
      }
  ]
  </code></pre>