This code works fine for me:

In [1]: from gallery.models import Gallery
In [2]: g = Gallery.objects.all()[0]
In [3]: g.created_at
Out[3]: datetime.datetime(2010, 4, 1, 7, 11, 51)
In [4]: import datetime
In [5]: n = datetime.datetime.now()
In [6]: g.created_at > n
Out[6]: False
In [7]: [g.created_at, n]
Out[7]:
[datetime.datetime(2010, 4, 1, 7, 11, 51),
 datetime.datetime(2010, 7, 14, 8, 53, 22, 960271)]

Are you sure your self.date has been initialized and isn't None?



On Jul 14, 4:43 pm, Chris McComas <mccomas.ch...@gmail.com> wrote:
> This is my model, I'm trying to set it so that if the game is in the
> future, based on the field date, then to return True, if not return
> False.
>
> http://dpaste.com/218111/
>
> I am importing datetime in my models.py but for some reason it's
> giving me nothing. I tried displaying future and nothing shows up?
> What have I done wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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