How would I make a manager that will return all the entries in a model with todays date, the model field is a datetime field, not a datefield?
timestamp = models.DateTimeField(auto_now=True)
class ValidEntryManager(models.Manager):
def get_query_set(self):
return super(ValidEntryManager, self).get_query_set().filter(timestamp__gte=datetime.today(), timestamp__lte=datetime.today())
allowed_entries = ValidEntryManager()
This is what I tried, but it returns 0 objects, there should be.
print Entries.allowed_entries.all() >>>> []