Wow, I should've caught that. Thanks guys. However, since I needed a
string, what I did was add "default=x" to the integer field as
follows:

class Phone(models.Model):
        phonenumber = models.IntegerField(default=10)
        pub_date = models.DateTimeField('date published')
        def __unicode__(self):
                return self.phonenumber

and it worked.

On Feb 20, 2:39 pm, Babatunde Akinyanmi <[email protected]> wrote:
> @Daniel
> Your __unicode__ should always return a string  so like Shawn said,
> when you check your phone model, its __unicode__ method should be
> returning str() or unicode() not int
>
> On 2/20/12, Shawn Milochik <[email protected]> wrote:
>
> > Read theerrormessage in your subject line. Then look at the
> > __unicode__ method of your Phone model. It appears that this is the
> > problem, and not the Device model.
>
> > --
> > 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.
>
> --
> Sent from my mobile device

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

Reply via email to