Actually, somewhere in the view:
dif = datetime.timedelta(days=1)
today = datetime.date.today()
yesterday = today - dif
ex = Fact.objects.filter(fecha_fact__lte=today ,fecha_fact__gte=yesterday )
It results to this SQL Query:
SELECT `facts_fact`.`id` ...
FROM `facts_fact`
WHERE (`facts_fact`.`fecha_fact` >= 2009-09-21 AND `facts_fact`.`fecha_fact` <= 2009-09-22 )
There is a way to make Django do a WHERE BETWEEN sentence instead >= <= ?
:) thx.