Hi,

Excuse me for the dumb question.

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 + ' - '
        else:
            retval = self.location_type + ' - '
        return retval
          
    class Meta:
        app_label = 'contacts'


I get an error saying :
TypeError at /contacts/phonenumber/
unsupported operand type(s) for +: 'location_type' and 'str'

How do I get the location_type __unicode__ for the fk?

Thanks in advance

Regards Ganesh



--~--~---------~--~----~------------~-------~--~----~
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