我有一个这样的模型:
class Site(models.Model):
name = models.CharField(max_length=255, unique=True, verbose_name=_("site name"))
frequency = models.IntegerField(default=60, verbose_name=_("visit frequency"))
last_visit_time = models.DateTimeField(blank=True, null=True, verbose_name=_("last visit time"))
frequency
中Minutes
的访问次数为<{1}}。
当我尝试找到site
来访问时:
Site.objects.filter(last_visit_time__lte=timezone.now() - timedelta(minutes=F('frequency')))
我收到此错误:
unsupported type for timedelta minutes component: F
有什么想法吗?