Re: problems with order by month

2018-08-22 Thread Franklin Sarmiento
hi Osvaldo, try filtering by date ( by month and date ), do you can filter by month and day ??? if this is what do you want, so, you can filter by date by example: "fechanacimiento__date", so, the queryset sould be this: Alumno.objecs.filter(.).order_by('fechanacimiento__date') # by default i

Re: problems with order by month

2018-08-22 Thread Phako Perez
I think you miss the column to order cardio = Alumno.objects.filter ( fechanacimiento __month = now.month).order_by(‘fechanacimiento’) Should be cardio = Alumno.objects.filter ( fechanacimiento __month = now.month).order_by(‘fechanacimiento_day’) Sent from my iPhone > On Aug 21, 2018, at 6:

Re: problems with order by month

2018-08-21 Thread Osvaldo Ruso Olea
I can not do is sort the dates from lowest to highest, > > > > Thank you very much > > > > El lun., 20 ago. 2018 a las 19:03, Matthew Pava () > escribió: > > Try this: > > cardio = Alumno.objects.filter(fechanacimiento__month=timezone.now().month) > > >

Re: problems with order by month

2018-08-21 Thread Osvaldo Ruso Olea
o. 1991- 14 Ago. 1992- 6 Ago. 1993- 13 >>Ago. 1993* >> >> >> >> >> El mar., 21 ago. 2018 a las 10:14, Matthew Pava () >> escribió: >> >>> You can chain the methods. >>> >>> cardio = Alumno.objects.filter ( fechanacimiento

Re: problems with order by month

2018-08-21 Thread Franklin Sarmiento
objects.filter ( fechanacimiento __month = >> now.month).order_by(‘fechanacimiento’) >> >> >> >> >> >> *From:* django-users@googlegroups.com [mailto: >> django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea >> *Sent:* Monday, Au

Re: problems with order by month

2018-08-21 Thread Franklin Sarmiento
> now.month).order_by(‘fechanacimiento’) > > > > > > *From:* django-users@googlegroups.com [mailto: > django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea > *Sent:* Monday, August 20, 2018 9:49 PM > *To:* django-users@googlegroups.com > *Subject:* Re: proble

Re: problems with order by month

2018-08-21 Thread Osvaldo Ruso Olea
u very much > > > > El lun., 20 ago. 2018 a las 19:03, Matthew Pava () > escribió: > > Try this: > > cardio = Alumno.objects.filter(fechanacimiento__month=timezone.now().month) > > > > *From:* django-users@googlegroups.com [mailto: > django-users@googlegroup

RE: problems with order by month

2018-08-21 Thread Matthew Pava
@googlegroups.com Subject: Re: problems with order by month You are a genius, thank you very much, it worked perfectly, I just made one more modification def cardio (request): now = timezone.now () cardio = Alumno.objects.filter ( fechanacimiento __month = now.month) context = {'c

Re: problems with order by month

2018-08-20 Thread Osvaldo Ruso Olea
m:* django-users@googlegroups.com [mailto: > django-users@googlegroups.com] *On Behalf Of *Osvaldo Ruso Olea > *Sent:* Monday, August 20, 2018 2:58 PM > *To:* Django users > *Subject:* problems with order by month > > > > Hi how are you, I have problems filtering and sorting

RE: problems with order by month

2018-08-20 Thread Matthew Pava
Try this: cardio = Alumno.objects.filter(fechanacimiento__month=timezone.now().month) From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Osvaldo Ruso Olea Sent: Monday, August 20, 2018 2:58 PM To: Django users Subject: problems with order by month Hi how are

problems with order by month

2018-08-20 Thread Osvaldo Ruso Olea
Hi how are you, I have problems filtering and sorting by date, precisely per month. my intention is to filter the database for birthdays in the current month. def cardio(request): cardio = Alumno.objects.order_by('fechanacimiento') contexto = {'cardio':cardio} return render(request