human
Get models ordered by an attribute that belongs to its OneToOne model
assistant
Here is some code to django get first 10 records of model `User` ordered by criteria 'age' of model 'pet'

User.objects.order_by('-pet__age')[:10]

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.