tags:

views:

32

answers:

1

I have created a Django model called Person, which has got a 'user' ForeignKey to django.contrib.auth.models.User

How can I set the ordering on class Person to self.user.first_name, self.user.last_name?

+1  A: 
class Meta:
    ordering = ['user__first_name', 'user__last_name']

Should do the trick iirc

Klette