Re: Help - m2m field in my model

2008-06-07 Thread M.Ganesh
[EMAIL PROTECTED] wrote: > The point for those "magic methods" in python is to provide a common > api to them, it's the same reason you do len(sequence) instead of > sequence.__len__(), or the reason we do 3 + 4 instead of 3.__add__(4). > > Thanks for your time Regards Ganesh

Re: Help - m2m field in my model

2008-06-07 Thread [EMAIL PROTECTED]
The point for those "magic methods" in python is to provide a common api to them, it's the same reason you do len(sequence) instead of sequence.__len__(), or the reason we do 3 + 4 instead of 3.__add__(4). On Jun 7, 2:42 am, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >

Re: Help - m2m field in my model

2008-06-07 Thread M.Ganesh
[EMAIL PROTECTED] wrote: > Don't use the internal method, instead do unicode(self.location_type) > + ' - ' > > Done. BTW is there any specific reason for this suggestion? Thanks Ganesh --~--~-~--~~~---~--~~ You received this message because you are

Re: Help - m2m field in my model

2008-06-06 Thread [EMAIL PROTECTED]
Don't use the internal method, instead do unicode(self.location_type) + ' - ' On Jun 6, 9:27 pm, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > Rajesh Dhawan wrote: > > >> My model : > > >> class phonenumber(models.Model): > >>     location_type = models.ForeignKey(location_type) > >>    

Re: Help - m2m field in my model

2008-06-06 Thread M.Ganesh
Rajesh Dhawan wrote: > >> My model : >> >> class phonenumber(models.Model): >> location_type = models.ForeignKey(location_type) >> location_description = models.CharField(max_length=50, blank=True) >> >> def __unicode__(self): >> if self.location_description: >>

Re: Help - m2m field in my model

2008-06-06 Thread Rajesh Dhawan
> My model : > > class phonenumber(models.Model): >     location_type = models.ForeignKey(location_type) >     location_description = models.CharField(max_length=50, blank=True) > >     def __unicode__(self): >         if self.location_description: >             retval =

RE: Help - m2m field in my model

2008-06-06 Thread Emily Rodgers
> -Original Message- > From: django-users@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of M.Ganesh > Sent: 06 June 2008 14:19 > To: django-users@googlegroups.com > Subject: Help - m2m field in my model > > > Hi, > > Excuse me for the dumb question. > > My model : > >

Re: Help - m2m field in my model

2008-06-06 Thread cory
Make sure that location_type has a __str__() and/or __unicode__() field set, and it's returning a str. Cory On Jun 6, 8:18 am, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > Hi, > > Excuse me for the dumb question. > > My model : > > class phonenumber(models.Model): > location_type =