Hello all,
I'm following the Django tutorial [1] I'm using windows xp, python 2.5 and SQLite. For some reason I found these 2 things not being appropiate as followed in the tutorial:
1) When tried "python manage.py sql polls" I got this
TypeError: __init__() got an unexpected keyword argument 'max_length'.
I could only run it successfully by changing the linea
question = models.CharField(max_length=200)
to
question = models.CharField(maxlength=200)
(stripped off the undrescore in "max_length")
2) Continuing down to the "Playing with the API" section, and once I saved some poll objects to the DB, etc I executed the following command as specified in the tutorial:
Poll.objects.all()
For some reason, the result I get from the shell is
>>> Poll.objects.all()
[<Poll: Poll object>]
Even when I inserted the __unicode__() method in models.py as follows:
class Poll(models.Model):
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.question
Anything I'm doing wrong?
Thanks a lot
regards
Mario
[1]
http://www.djangoproject.com/documentation/tutorial01/