On Thu, Mar 19, 2009 at 7:36 PM, Nate Reed <natereed....@gmail.com> wrote:

> On Thu, Mar 19, 2009 at 4:29 PM, Alex Gaynor <alex.gay...@gmail.com>wrote:
>
>>
>>
>> On Thu, Mar 19, 2009 at 7:21 PM, Nate Reed <natereed....@gmail.com>wrote:
>>
>>> I'm working on an admin interface for my app, and wondering how to
>>> customize what gets displayed.
>>>
>>> Under Home->MyModels->MyModels, MyModel instances are listed as "MyModel
>>> object."  When editing another model, the foreign key reference to MyModel
>>> gets displayed as a list of:
>>>
>>> MyModel object
>>> MyModel object
>>> ....
>>> etc
>>>
>>> I'd like it to make it show MyModel.name instead.  How is this changed?
>>>
>>> Nate
>>>
>>>
>>>
>> Using the __unicode__ method on models.  If you read through the tutorial
>> you'll see how this works.
>>
>> Alex
>>
>
> Thanks.
>
> There's no mention of it in the section on the admin site.  Is __unicode__
> used for anything else?
>
>
>
>
> >
>
__unicode__ is used for almost every default display of an object.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to