Re: Users Full Name in model form?

2009-09-07 Thread Mike Dewhirst
Streamweaver wrote: > This was through a custom form in a public view. I haven't done much > with admin forms but maybe someone else knows? > > > > On Sep 4, 4:50 pm, Anthony Simonelli wrote: >> Is this within the Admin interface? If so, I'm having a similar >>

Re: Users Full Name in model form?

2009-09-07 Thread Streamweaver
This was through a custom form in a public view. I haven't done much with admin forms but maybe someone else knows? On Sep 4, 4:50 pm, Anthony Simonelli wrote: > Is this within the Admin interface?  If so, I'm having a similar > problem.  I have a model called Request

Re: Users Full Name in model form?

2009-09-04 Thread Anthony Simonelli
Is this within the Admin interface? If so, I'm having a similar problem. I have a model called Request with a FK relationship to an Employee model. Within the Admin interface, when adding a Request, the drop-down of the Employees selection read "Employee Object". This is also the case when

Re: Users Full Name in model form?

2009-09-04 Thread Streamweaver
I put a solituion for this in the form of where this is passed a user object. class UserChoiceField(forms.ModelChoiceField): ''' Returns a select field with user names formatted by last and first name where available and ordered by last name. ''' def label_from_instance(self,

Users Full Name in model form?

2009-09-04 Thread Streamweaver
I had a model that lists an owner with a FK relationship to the Users table. When using model form the dropdown for the owner field defaults to the username. I'd like to override that to use a users name as the choice portion of the dropdown sorted by users last name but I'm having trouble