In models:

birthday = models.DateField()

def birthday_month_day(self):
      # returns month and day
      return '12-31'


In views, I expect to see something pythonic like this:

User.objects.all().order_by('birthday_month_day')

I know it does not work because birthday_month_day is not a column in
database.

The question is how to get as result a list of all the users ordered by
birthday (month + day), ignoring year. (queryset order_by DateField month
day)

Can you help me? Anyone has faced this question before?

Thanks



-- 
Roberta Takenaka

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ9dYMF91gZBhmUvJp4hOAMti8SUy%3DGEQd7gQLozC6VW%3DAhjvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to