[Django]-Django generates 'WHERE … BETWEEN …' sentences?

4👍

Have you tried range?

Fact.objects.filter(fecha_fact__range=(yesterday, today))

0👍

i dont know, but maybe (gte / lte ):

q1 = Entry.objects.filter(headline__startswith="What")
q2 = q1.exclude(pub_date__gte=datetime.now())
q3 = q1.filter(pub_date__gte=datetime.now())


q = Entry.objects.filter(headline__startswith="What")
q = q.filter(pub_date__lte=datetime.now())
👤Asinox

Leave a comment