我对下一个模型有疑问:
class Product(models.Model):
id_product = models.AutoField(primary_key=True)
title = models.CharField()
def __unicode__(self):
return self.title
class Orders(models.Model):
id_order = models.AutoField(primary_key=True)
product = models.ForeignKey(Product)
description = models.CharField(max_length=150, null=True, blank=True)
date = models.DateTimeField()
def __unicode__(self):
return self.description
如何列出所有产品和每个产品的最后订单?
谢谢。