2

I am attempting to filter all entries in a table created today, but it wont allow me to use .date() on the column created.

Here is the sourcecode for the filter:

StartupHistory.objects.filter(user=2).filter(created.date()=datetime.date.today())

Example

>>> resultset = StartupHistory.objects.filter(user=2)
>>> for element in resultset:
...     print element.created.date()
... 
2014-03-12
2014-03-12
2014-03-12
2014-03-12
JavaCake
  • 4,075
  • 14
  • 62
  • 125

1 Answers1

2

You can filter it like this:

StartupHistory.objects.filter(user=2).filter(created__startswith=datetime.date.today())