Re: How to display other field(not the foreign key) in admin dropdown list

2010-03-31 Thread Asim Yuksel
Okey I want to answer this :) just add a unicode method to your model
something like this

def __unicode__(self):
return "%s" % self.name

On 31 Mart, 16:37, Asim Yuksel  wrote:
> I have a people table and a bridge table which are related. bridge
> table has a foreignkey field for people table.
>
> When I click add from django admin it shows the peopleid in a drop
> down list. What I want to do is I want to show the people.name field
> instead of peopleid foreignkey field? How can I do this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



How to display other field(not the foreign key) in admin dropdown list

2010-03-31 Thread Asim Yuksel
I have a people table and a bridge table which are related. bridge
table has a foreignkey field for people table.

When I click add from django admin it shows the peopleid in a drop
down list. What I want to do is I want to show the people.name field
instead of peopleid foreignkey field? How can I do this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.