+1  A: 

Django ordering is done in the database level. Unless you store the result of your unicode function in the DB, django is not going to be able to natively return results ordered in that fashion.

Storing an ordering value in the DB is probably the most expedient way to solve this problem.

Paul McMillan
Thanks for this, Paul. I had reached the same conclusion, but was hoping I might be mistaken! This then begs the question of *how* to store the ordering value in the DB. Maybe with the aid of a post_save signal? I'm working on this now, but if anyone knows the best way, please post it; I'm sure you'll save me (and anyone else looking for advice about this topic) quite a bit of time! Thanks again.
sampablokuper
Yeah, a post-save is probably the way to do it. I also wish there was a more convenient way to do this, but your next best bet is going to involve getting query sets from the DB, sorting them in python, and then sending them back to the admin interface which is way more work than it's worth.
Paul McMillan
I tried to put the code for this in a comment here, but that didn't work. So I've created [another answer][1] to hold it.[1]: http://stackoverflow.com/questions/1406745/order-django-admin-change-list-column-by-output-of-unicode-method/1412299#1412299
sampablokuper
A: 

Following Paul McMillan's suggestion, I added the following line to the class definition of Person:

ordering_string = models.CharField(max_length=255, null=True, blank=True)

I also put the this above the PersonName definition in models.py:

def post_save_person_and_person_name(sender, **kwargs):
    person_name = kwargs['instance']
    person = person_name.person
    if person.ordering_string != unicode(person)[0:254]:
        person.ordering_string = unicode(person)[0:254]
        super(Person, person).save()

and put this below the PersonName definition in models.py:

post_save.connect(post_save_person_and_person_name, sender=PersonName)

So far, so good.

I think I might be able to improve on it by replacing the save() call above with a queryset update() . I'd welcome suggestions on that front!

sampablokuper
Cool. Usually the thing to do is to edit the original question with more info like this. Glad it's working out for you!
Paul McMillan
Ah, OK. I'll do that next time. I can't say I find the workflow on StackOverflow enirely intuitive, and I guess the community is simultaneously evolving its own conventions too, as in this case. Thanks for correcting me!
sampablokuper
Yeah, I agree there are definitely a few rough spots in the UI, but the community is really fantastic for finding answers quickly.
Paul McMillan