Re: comparing date and datetime

2009-08-06 Thread Gustavo Henrique
Sorry, it were an human error! Solved! -- Gustavo Henrique http://www.gustavohenrique.net http://blog.gustavohenrique.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

comparing date and datetime

2009-08-06 Thread Gustavo Henrique
Hi! I'm trying to compare 2 dates and appears the error message: can't compare datetime.datetime to datetime.date But in the shell is ok. why? date1 = models.DateField() date2 = datetime.date.today() --~--~-~--~~~---~--~~ You received this message because you are

Re: Comparing date

2007-10-30 Thread Nicolas Steinmetz
Doug B a écrit : > Try just using the year attribute on the datetime instance. > > {% ifequal training.start_date.year training.end_date.year %} > ... Thanks a lot. It works ! Nicolas --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Comparing date

2007-10-30 Thread Doug B
Try just using the year attribute on the datetime instance. {% ifequal training.start_date.year training.end_date.year %} ... On Oct 30, 12:28 pm, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > Hello, > > Issue : I would like to compare date at year level only. Idea is to > display the year o

Comparing date

2007-10-30 Thread Nicolas Steinmetz
Hello, Issue : I would like to compare date at year level only. Idea is to display the year only once if the two date are within the same year. I have the following model : class Training(models.Model): who = models.ForeignKey(User, verbose_name='Person') title = models.CharField('Na