On Mar 30, 6:11 am, Alfonso <allanhender...@gmail.com> wrote:
>
> And in my search view I have a simple filter (which is where I think
> the problem lies):
>
> if date == "next30":
>        results = queryset.filter(date_time>=(datetime.datetime.now))
>
> (Attempting to pull future dates just to see something happen)
>
> Where am I going wrong?

Assuming date_time is a field on your model:

results = queryset.filter(date_time__gte=datetime.datetime.now())

See the docs on field lookups:
http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups

Also, you want to construct a datetime object that is equal to now,
not compare your field to the datetime.datetime.now function.

-BN
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to