Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-21 Thread Tom Evans
On Tue, Feb 21, 2012 at 5:18 PM, Daniel Marquez wrote: > 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 =

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-21 Thread Shawn Milochik
On Tue, Feb 21, 2012 at 12:18 PM, Daniel Marquez < daniel.marquez0...@gmail.com> wrote: > 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 =

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-21 Thread Daniel Marquez
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

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Furbee
As an aside, I would assume you want your phone number field to be a string (models.CharField) instead of integer. Furbee On Mon, Feb 20, 2012 at 2:39 PM, Babatunde Akinyanmi wrote: > @Daniel > Your __unicode__ should always return a string so like Shawn said, > when you

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Babatunde Akinyanmi
@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 wrote: > Read the error message in your subject line. Then look at the

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Shawn Milochik
Read the error message 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

I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Daniel Marquez
Hey all, I am a beginner django user. I am going through the tutorial, but when I post the following I get the TypeError: coercing to unicode: class Phone(models.Model): phonenumber = models.IntegerField() pub_date = models.DateTimeField('date published') def

Re: TypeError: coercing to Unicode: need string or buffer, long found

2010-01-05 Thread E. Hakan Duran
On Tuesday 05 January 2010 21:01:44 Karen Tracey wrote: > ... > Change this to return unicode(self.coupleid) > Thanks! signature.asc Description: This is a digitally signed message part.

Re: TypeError: coercing to Unicode: need string or buffer, long found

2010-01-05 Thread Karen Tracey
On Tue, Jan 5, 2010 at 8:32 PM, E. Hakan Duran wrote: >def __unicode__(self): >return self.coupleid > --- > > Change this to return unicode(self.coupleid) Karen -- You received this message because you are subscribed to the Google Groups "Django users"

TypeError: coercing to Unicode: need string or buffer, long found

2010-01-05 Thread E. Hakan Duran
Hi all, I am just following the tutorial with minimal coding skills/knowledge. I have a models.py file part of which is shown below: --- # -*- coding: utf-8 -*- from django.db import models import datetime # Create your models here. class Couple(models.Model): coupleid =