Thanks!

On Dec 22, 10:16 am, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Sun, 2008-12-21 at 23:07 -0800, sunn wrote:
>
> [...]
>
> > I would like to order my Block objects by first page.sortorder and
> > then sortorder. Any idea on how to accomplish this?
> > I have tried with ordering = ['page.sortorder', 'sortorder'] but this
> > does not work ("ordering" refers to "page.sortorder", a field that
> > doesn't exist).
>
> You're close:
>
>         ordering = ['page__sortorder', 'sortorder']
>
> You refer to related fields for ordering using the same syntax as in
> filter() calls. The documentation for that (including ordering by
> related fields) is here:
>
> http://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by-f...
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to