class Product(models.Model):
product_name = models.CharField(null=True, blank=True)
branch = models.ForeignKey(Branch, null=True)
class StaffUser(models.Model):
branch = models.ForeignKey(Branch,null=True, blank=True)
dob = models.DateField(null=True, blank=True)
答案 0 :(得分:0)
引用两个表然后加入use。 prefetch_related或selected_related查询