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 <tundeba...@gmail.com> 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 <sh...@milochik.com> 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 django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscribe@googlegroups.com.
> > 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 django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment