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
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:
ehalf Of *Osvaldo Ruso Olea
> *Sent:* Monday, August 20, 2018 9:49 PM
> *To:* django-users@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
>
>
>
>
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
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
> 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
gt;
> cardio = Alumno.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, August 20, 2018 9:49 PM
> *To
@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
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 = {'cardio': cardio}
return render (request, 'cardio.html', co
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
10 matches
Mail list logo