有型号:
class MyObject (models.Model):
name = models.CharField ()
class Day (models.Model):
day = models.IntegerField ()
class Month (models.Model):
month = models.IntegerField ()
myobj = models.ForeignKey (MyObject)
days = models.ManyToManyField (Day)
用户在网站上使用表格介绍了一个月。我提出一个要求:
MyObject.objects.filter (month__month = <month, which is entered by the user with the form>
<day, which is entered by the user with the form> in month__days????
)
如何在模型 Month 的 m2m 通信天数中查看用户输入的日期是(存在)的查询?