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 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
ardio = 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
> *T
Pava ()
>> escribió:
>>
>>> You can chain the methods.
>>>
>>> cardio = Alumno.objects.filter ( fechanacimiento __month =
>>> now.month).order_by(‘fechanacimiento’)
>>>
>>>
>>>
>>>
>>>
>>> *From:* dj
y(‘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
>
hanacimiento’)
>
>
>
>
>
> *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: problems with order by month
>
&g
umno.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:* django-users@goog
@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 = {'cardio
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',
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