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:
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)
>
>
>
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
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
@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
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
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
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
11 matches
Mail list logo