On 6/21/06, Mikeal Rogers <[EMAIL PROTECTED]> wrote:
> class Item(models.Model):
>         name = models.Charfield(maxlength=100)
>         user = models.ForeignKey(User)
>
>         def get_user_name(self):
>                 return self.user.name
>
>         class Admin:
>                 list_display = ('name', 'get_user_name')
>                 ordering = ('get_user_name', 'name')

Hi Mikael,

You can't order by the result of a Python function, because the
ordering clause happens at the SQL level, not in Python.

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to