On Tue, 2009-03-03 at 06:56 -0800, Bela Hausmann wrote:
> I've got two models: a Category model and a Message model. The Message
> model has a timestamp 'time_created', by which the messages are sorted
> per default. My problem is, that I want to make a list of categories
> ordered by the time_created date of the newest message in every
> category. Anyboy can help how to do that in django?
>
> I tried:
>
> Category.objects.order_by('messages')
>
> but that doesn't work like I would like it to.
This is described in the fourth paragraph of the documentation for
order_by().
http://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by-fields
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---