Hi,

I have a general question regarding the ordering in
the ManyRelatedManager object.  For example,
There are two classes in my model:  one is
called Book for books and another is Author for authors.

A many-to-many field is defined  in class Book
    authors = models.ManyToManyField(Author)

In database, the many-to-many relationship
is described in an additional table book_author
with three columns: (id, book_id, author_id)

Now for a Book object b, both b.authors.all() and b.authors.iterator()
are sorted in the order of book_author.author_id.
But what I want is to retrieve the authors of b
in the order of book_author.id because this is
the right order of the authors.

Any solution? Many thanks in advance!



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to