django如何通过ManyToManyField过滤?

时间:2017-07-31 13:57:53

标签: python django postgresql

我有模特:

class DamageKind(models.Model):
    # the possible regions for this kind of damage
    regions = models.ManyToManyField(Region)
    [...]

class Damage(models.Model):
    region = models.ForeignKey(Region)
    kind = forms.models.ModelChoiceField(queryset=???)
    [...]

如何获取仅包含selectet区域可能的damagekinds的查询集?

提前致谢

0 个答案:

没有答案