我有两种模式:
class Contact(models.Model):
name = models.CharField(max_length=255)
class Campaign(models.Model):
contact = models.ForeignKey(Contact, related_name="campaigns")
name = models.CharField(max_length=255)
如何在广告系列表格中选择广告系列名称='CampaignName'的所有联系人?
答案 0 :(得分:1)
Contact.objects.filter(campaign__name='CampaignName')