title: Django - Getting latest of each choice
body: <p>I have two models: the gas station and the price of a product. The price can up to have 4 choices, one for each product type, not every station has all four products. I want to query the latest entry of each of those products, preferably in a single query:</p>
  
  <pre><code>   class GasStation(models.Model):
          place_id = models.IntegerField(primary_key=True)
          name = models.CharField(max_length=255, null=True, blank=True)
  
      class Price(models.Model):
  
          class Producto(models.TextChoices):
              GASOLINA_REGULAR = 'GR', _('Gasolina regular')
              GASOINA_PREMIUM = 'GP', _('Gasolina premium')
              DIESEL_REGULAR = 'DR', _('Diesel regular')
              DIESEL_PREMIUM = 'DP', _('Diesel premium')
  
          product = models.CharField(max_length=2, choices=Producto.choices)
          created = models.DateTimeField(auto_now_add=True)
          updated = models.DateTimeField(auto_now=True)
          price = models.FloatField(null=True, blank=True)
          estacion = models.ForeignKey(GasStation,
                               on_delete=models.SET_NULL,
                               null=True,
                               related_name='prices')
  </code></pre>
  
  <p>I've tried with:</p>
  
  <pre><code>station.price.filter(product__in=['GR', 'GP', 'DR', 'DP']).latest()
  </code></pre>
  
  <p>But it only returns the latest of the whole queryset, not the latest price of each product type. I want to avoid querying for each individual product because some stations don't sell all types .Any advice?</p>