Re: related object's fields in the admin options

2006-07-14 Thread Gary Wilson
I think I will first attempt to allow order_by to accept related objects, like order_by('user__last_name'). Could someone please point me in the right direction? I am not too familiar with django's db code. What all would need changing? --~--~-~--~~~---~--~~ Yo

Re: related object's fields in the admin options

2006-07-14 Thread Luke Plant
Gary Wilson wrote: > Please look at my original post, I am not trying to use a > get_last_name() method. Yes, sorry, I realised this just after I wrote that e-mail and wrote a better reply. Luke --~--~-~--~~~---~--~~ You received this message because you are su

Re: related object's fields in the admin options

2006-07-13 Thread Gary Wilson
Luke Plant wrote: > In that particular case, yes (and in this instance it might be possible > to implement what you want be writing a custom manager and overriding > get_query_set() so that it adds a join and custom ordering), but there > is no (feasible) way of introspecting get_last_name() and w

Re: related object's fields in the admin options

2006-07-13 Thread Luke Plant
On Thursday 13 July 2006 22:07, Luke Plant wrote: > In that particular case, yes (and in this instance it might be > possible to implement what you want be writing a custom manager and > overriding get_query_set() so that it adds a join and custom > ordering), but there is no (feasible) way of in

Re: related object's fields in the admin options

2006-07-13 Thread Luke Plant
On Thursday 13 July 2006 20:26, Gary Wilson wrote: > Luke Plant wrote: > > On Wednesday 12 July 2006 21:27, Gary Wilson wrote: > > > Jay Parlar wrote: > > > > You can use functions inside list_display: > > > > > > > > class Admin: > > > > list_display = ('get_last_name',) > > > > > >

Re: related object's fields in the admin options

2006-07-13 Thread Gary Wilson
Luke Plant wrote: > On Wednesday 12 July 2006 21:27, Gary Wilson wrote: > > Jay Parlar wrote: > > > You can use functions inside list_display: > > > > > > class Admin: > > > list_display = ('get_last_name',) > > > > > > def get_last_name(self): > > > return self.user.last_n

Re: related object's fields in the admin options

2006-07-12 Thread Luke Plant
On Wednesday 12 July 2006 21:27, Gary Wilson wrote: > Jay Parlar wrote: > > You can use functions inside list_display: > > > > class Admin: > > list_display = ('get_last_name',) > > > > def get_last_name(self): > > return self.user.last_name > > get_last_name.short_desc

Re: related object's fields in the admin options

2006-07-12 Thread Gary Wilson
Jay Parlar wrote: > You can use functions inside list_display: > > class Admin: > list_display = ('get_last_name',) > > def get_last_name(self): > return self.user.last_name > get_last_name.short_description = "Last Name" But you can't sort or seach it. --~--~---

Re: related object's fields in the admin options

2006-07-12 Thread Jay Parlar
On 7/12/06, Gary Wilson <[EMAIL PROTECTED]> wrote: > > So I've got a model resembling: > > == > from django.contrib.auth.models import User > > class ExtendedUser(models.Model): > user = models.OneToOneField(User) > > class Admin: > list_display = ('user',) > search

related object's fields in the admin options

2006-07-12 Thread Gary Wilson
So I've got a model resembling: == from django.contrib.auth.models import User class ExtendedUser(models.Model): user = models.OneToOneField(User) class Admin: list_display = ('user',) search_fields = ('user',) == The admin has a user column but it is so