On Nov 17, 8:35 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> 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.orgis a
> great one.
>
> For foreign keys, Django uses the unicode of the related model anyway.
> --
> DR.


Thanks a lot guys. Actually am working on a project that uses django.
I didn't have much time to learn python. just went through the things
i need for the project. hope  will learn it soon :)
--~--~---------~--~----~------------~-------~--~----~
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