I want to compare a DateField and a TimeField in a queryset with the current date. I searched for hours but did not find anything. Tried much with Q/F-Object but no solution, too. And now I am here and hope someone knows how to solve this :) - Btw. splitting into date and time is not my fault and there is no way to change it into a DateTimeField (too much dependencies in other projects).
class Model(models.Model):
date = models.DateField()
time = models.TimeField()
In MySQL I would do something like:
SELECT * FROM app_model WHERE CAST(CONCAT(CAST(date as CHAR),' ',CAST(time as CHAR)) as DATETIME) >= NOW()
Thanks for any suggestions!