我有两个django模型:
class RegistrationDetail(models.Model):
registration_number = models.CharField(
_("Registration Number"),
max_length=32,
unique=True,
db_index=True)
policies = models.ManyToManyField('Policy', blank=True)
class Policy(Models.model):
policy_id = UUIDField(unique=True)
issue_date = models.DateTimeField(null=True)
start_date = models.DateField()
expiry_date = models.DateField()
我必须形成一个查询,找出附加到相应注册号的所有政策,然后比较特定注册号的相应政策的开始日期是否有300天的差异。如何继续此查询?