class Price(models.Model):
date = models.DateField()
price = models.DecimalField(max_digits=6, decimal_places=2)
product = models.ForeignKey("Product")
class Product(models.Model):
name = models.CharField(max_length=256)
price_history = models.ManyToManyField(Price, related_name="product_price", blank=True)
x 날짜의 가격이 이전 날짜보다 높은 제품 만 반환하도록 제품을 쿼리하고 싶습니다.ForeignKey 하위 요소 간의 관계를 기반으로 장고 모델을 쿼리합니다.
감사 인사.