On Feb 7, 10:50 pm, SimpleDimple <farhandevelo...@gmail.com> wrote: > I am new to django and building a school system but am experience > developer otherwise having firm grip over rails, php, .net and java. > > I can see the list and do sorting & search but only based on the > fields which are in the same table... what if I want to sort on or > search on field which is in another table ? something like > > select class.* from class, session > where class.session_id = session.id > order by session.starting_date
Class.objects.order_by(session__starting_date) see docs for order_by method of QuerySet http://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.