Hi all, <Initial_statement>I am just following the tutorial with minimal coding skills/knowledge.</Initial_statement>
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 = models.AutoField('Couple ID', primary_key=True)
entry_date = models.DateField('Date Entered')
home_address1 = models.CharField(max_length=200)
home_address2 = models.CharField(max_length=200)
city = models.CharField(max_length=100)
state = models.CharField(max_length=2, null=True)
country = models.CharField(max_length=100, default="United States")
home_phone = models.CharField(max_length=20)
def __unicode__(self):
return self.coupleid
-------
The query "Couple.objects.all()" from 'python manage.py shell' returns the
error message at the subject line of this e-mail with other jibberish.
My understanding is that this problem arises because coupleid is a long
integer, whereas unicode function was expecting a string or a buffer. Is there
a quick and dirty solution for this, because I really want to the 'coupleid'
to represent itself. I am working on django 1.1.1, mysql and Mandriva linux
2010.0.
signature.asc
Description: This is a digitally signed message part.

