[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
--~--~-
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:
> > Don
[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 subscribe
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)
> >> location_descr
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:
>>
> 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 = self.location_description
> -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 :
>
> cla
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 = models.Foreign
8 matches
Mail list logo