hi thanks Malcolm
i already have __str__ method on my Teacher class.
its definition is
def __str__(self)
   return self.name

where name is a CharField . we will be getting the name from the admin gui
page


thanks and regards

ashok



On 3/5/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
>
> On Sun, 2007-03-04 at 21:56 -0800, MacH wrote:
> > hi i m a newbie to django and was trying creating some apps .
> > i have 2 classes namely  Teacher  and Student . Added ManyToManyField
> > in Student  class referring to Teacher such that (Teachername =
> > models.ManyToManyField(Teacher) ) .
> > Using list_display method trying to list all the rows in Student
> > class .
> > my list display method is
> > list_display('student_name','student_no','display_teacher')
> > here display_teacher is a function . its definition is
> >
> > def display_teacher(self):
> >       return self.teachername.all()
> >
> > wat i could see in my gui is like this [<Teacher: ken thomson>,
> > <Teacher: richie>]
> >
> > but i excpect to show like ken thomson, richie.      ...... pls
> > someone could tell me how to do the same
>
> Sounds like you need to define a __str__ method on your Teacher class.
>
> Regards,
> Malcolm
>
>
> >
>


-- 
ashok

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to