Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread TP
Still working through this tutorial. I have got the problem: TemplateDoesNotExist at /polls/ polls/index.html Traceback: Environment: Request Method: GET Request URL: http://localhost:8060/polls/ Django Version: 1.0.2 final Python Version: 2.5.1 Installed Applications: ['django.contrib.auth'

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread TP
Help was much appreciated, thanks ;) On Mar 17, 1:26 pm, Oliver Beattie wrote: > You're probably using the tutorial for the development (trunk) version > of Django, but you're running 1.0.x — you should be following this > tutorial:http://docs.djangoproject.com/en/1.0//intro/tutorial02/#activate

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
You're probably using the tutorial for the development (trunk) version of Django, but you're running 1.0.x — you should be following this tutorial: http://docs.djangoproject.com/en/1.0//intro/tutorial02/#activate-the-admin-site On Mar 17, 1:21 pm, TP wrote: > I have fixed this error: > > now wh

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread TP
I have fixed this error: now when I comes to view the admin site I get the error: AttributeError at /admin/ 'AdminSite' object has no attribute 'urls' On the webpage. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
Below that there will be an error. I'm guessing it may be a SyntaxError or NameError, since it looks like you have python after 'mysite.polls' (probably by accident) — that is if that traceback is right. On Mar 17, 12:36 pm, TP wrote: > This relates to the first tutorial on django project. > My

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread TP
This relates to the first tutorial on django project. My models.py file: from django.db import models import datetime class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __unicode__(self): return self.que

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Alex Gaynor
On Tue, Mar 17, 2009 at 8:29 AM, TP wrote: > > When I try to run the Python shell again I get this: > > python manage.py shell > Traceback (most recent call last): > File "manage.py", line 4, in >import settings # Assumed to be in the same directory. > File "/home/cserv2_a/ug/scs5tdp/Desk

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread TP
When I try to run the Python shell again I get this: python manage.py shell Traceback (most recent call last): File "manage.py", line 4, in import settings # Assumed to be in the same directory. File "/home/cserv2_a/ug/scs5tdp/Desktop/mysite/mysite/settings.py", line 79 'mysite.poll

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Ramiro Morales
On Tue, Mar 17, 2009 at 9:20 AM, TP wrote: > > Right I have now changed to use __unicode__ > > This looks like: > > > from django.db import models > > class Poll(models.Model): >    question = models.CharField(max_length=200) >    pub_date = models.DateTimeField('date published') >    def __unico

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread TP
>>> from mysite.polls.models import Poll, Choice >>> Poll.objects.all() [] Is my output. The desired output is: >>> Poll.objects.all() [] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread TP
Right I have now changed to use __unicode__ This looks like: from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __unicode__(self): return self.question def was_publishe

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
__unicode__ is called when unicode(ModelInstance) is called. __str__ is called when str(ModelInstance) is called. Internally, if you only define __unicode__, then Django will provide __str__ for you (see http://code.djangoproject.com/browser/django/trunk/django/db/models/base.py#L277 for the nit

Poll Tutorial regarding __unicode__

2009-03-17 Thread TP
I am currently running through the first tutorial on the django projects site. When I have added the __unicode__() method to my models I don't see any change in how they're represented. I am using Django 1.0.2 So an old version is not the problem. My models.py looks like this: from django.db i