Hi guy. so, A don't is understand very well. but the django has the generic date views, I think is exactly this.
https://docs.djangoproject.com/en/dev/ref/class-based-views/generic-date-based/#module-django.views.generic.dates 2014-05-27 9:06 GMT+01:00 hito koto <hitokoto2...@gmail.com>: > Hi, > > I want to get only year and get only month, > i want to get the only : 2005 and 05-27 > How can i to do? > > I know this : > > >>> Entry.objects.dates('pub_date', 'year')[datetime.date(2005, 1, 1)]>>> > >>> Entry.objects.dates('pub_date', 'month')[datetime.date(2005, 2, 1), > >>> datetime.date(2005, 3, 1)]>>> Entry.objects.dates('pub_date', > >>> 'day')[datetime.date(2005, 2, 20), datetime.date(2005, 3, 20)]>>> > >>> Entry.objects.dates('pub_date', 'day', order='DESC')[datetime.date(2005, > >>> 3, 20), datetime.date(2005, 2, 20)]>>> > >>> Entry.objects.filter(headline__contains='Lennon').dates('pub_date', > >>> 'day')[datetime.date(2005, 3, 20)] > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/f6351f85-5dbf-47f3-a475-122fb52e6fa2%40googlegroups.com<https://groups.google.com/d/msgid/django-users/f6351f85-5dbf-47f3-a475-122fb52e6fa2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Helton Alves Desenvolvedor web Graduado em Sistemas de Informação - FACIMP Cursando Metodologia do Ensino Superior - INESPO -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABcoSmBznZKLD9uWa3nkW0-Tw6QPT7GJ8tTyS6FFYLUx-6U1Qw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.