阅读背景:

在Django中我有一个复杂的查询,我只需要通过外键的唯一值,这可能吗?

来源:互联网 

I have the following models:

我有以下型号:

class Indicator(models.Model):
    name = models.CharField(max_length=200)
    category = models.ForeignKey(IndicatorCategory)
    weight = models.IntegerField()
    industry = models.ForeignKey(Industry)

    def __unicode__(self):
        return self.name
    class Meta:
        ordering = ('name',)

class IndicatorRatingOption(models.Model):
    indicator = models.ForeignKey(Indicator)
    description = models.TextField()
    value = models.FloatField(null=True)

    def __unicode__(self):
        return self.description

class Rating(models.Model):
    product = models.ForeignKey(Product, null=True)
    company = models.ForeignKey(Company, null=True)
    rating_option = models.ForeignKey(IndicatorRatingOption)
    value = models.IntegerField(null=True)
class 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: