On Wednesday, February 23, 2011 11:56:07 am wilbur wrote:
> Hello,
> 
> The table I am querying is set to return a fieldname that is defined
> as varchar... ex.
> 
> class Sample(models.Model):
>     sample_name = models.CharField(max_length=100)
>     location = models.CharField(max_length=100,blank=True,null=True)
>     country = models.CharField(max_length=50,blank=True,null=True)
>     ........"other fieldnames defined".........
>     def __unicode__(self):
>        #return unicode(self.sample_name)
>        return self.sample_name
> 
> Could it be that the error refers to one of the fields rendered in the
> individual record edit page instead. If so, how do I find out which
> one?
> 
> Thanks, Bill

I could not reproduce this with (note: both return values work as expected). I 
did get something when __unicode__() did not return a value (typo). But that's 
expected.:

class ArticleCategory(models.Model):
  title = models.CharField(max_length=50,  unique=True)
  description = models.TextField()
  slug = models.SlugField(editable=False)

  def __unicode__(self):
    #return u'%s' %(self.title)
    return self.title

using django 1.3 alpha  (current trunk)

ftr, you might want to update to django 1.2.5 there is a security release [1], 
it's in the ubuntu repos. But this shouldn't affect your issue.  

Mike

[1] http://www.ubuntu.com/usn/usn-1066-1

-- 
All your files have been destroyed (sorry).  Paul.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to