On Nov 17, 12:41 pm, Vicky <[EMAIL PROTECTED]> wrote:
> I found the problem.. I used :
>
> def __unicode__(self):
>
> function in my model. so it a can return only sting values. So if i
> need to return a column of type integer or contains a foreign key how
> should i do it??
>
return u'%s' % self.my_integer_attribute
or
return unicode(self.my_integer_attribute)
This is fairly basic Python. I'd recommend going through a Python
tutorial if you don't know any of this: www.diveintopython.org is a
great one.
For foreign keys, Django uses the unicode of the related model anyway.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---