Hey,

I want to get a list of events that are happening today and I'm using
this query:

Event.objects.filter(date__exact=datetime.now())

Simple enough, but it throws up this error:

AttributeError at /events/today/
'module' object has no attribute 'now'

My model looks like this:

title                   = models.CharField(maxlength=200)
slug                    = models.SlugField(prepopulate_from=('title',))
body                    = models.TextField()
created                 = models.DateTimeField(auto_now_add=True)
date                    = models.DateField()
time                    = models.TimeField()

Any ideas? I'm importing datetime at the top of my views.py file
(where the query is run).

Cheers,
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to