Here is my two attempts at trying to test if my DateTimeField is in
the past or the future.

# first attempt
def past(self):
        return self.scheduled_time < datetime.now()

# It complained that i cannot compare a datetime to a string, hence my
second attempt
# second attempt
def past(self):
        datetime_scheduled_time = strptime(self.scheduled_time, '%Y-%m-%d %H:
%M:%S')
        return datetime_scheduled_time < datetime.now()



Please help,

--~--~---------~--~----~------------~-------~--~----~
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