So I have added a many to many relationship to my model:
class Person(models.Model):
...
...
cars = models.ManyToManyField(Car)
When I do:
bob.add(mercedes)
bob.add(bmw)
And then do person.cars.all(), I get:
[bmw, mercedes]
I looked in the many-to-many table and the order there is correct. So it's something like:
id person car
1 bob mercedes
2 bob bmw
So all I need is to sort by many-to-many table's id column when retrieving cars. How to do it?