Re: Models Tutorial Django

2010-05-11 Thread Karen Tracey
On Tue, May 11, 2010 at 6:15 AM, HelloWorld wrote: > Hi Jirka > > Thanks for your answer! > > By structure I mean, I just followed the tutorial and am not sure if > the position and order of these tutorial code is right in my code: > > class Poll(models.Model): ># ... > def __unicode__(se

Re: Models Tutorial Django

2010-05-11 Thread Daniel Roseman
On May 11, 11:15 am, HelloWorld wrote: > Hi Jirka > > Thanks for your answer! > > By structure I mean, I just followed the tutorial and am not sure if > the position and order of these tutorial code is right in my code: > > class Poll(models.Model): >     # ... >     def __unicode__(self): >      

Re: Models Tutorial Django

2010-05-11 Thread Jirka Vejrazka
Hmm, I can't see anything wrong with your code, so I'm gonna go to the basics - how about your code indentation? Is the "def __unicode__()" the same way as your model field definitions? The __unicode__() function must be part of your Poll class, not standalone. Cheers Jirka On 11/05/2010,

Re: Models Tutorial Django

2010-05-11 Thread HelloWorld
Hi Jirka Thanks for your answer! By structure I mean, I just followed the tutorial and am not sure if the position and order of these tutorial code is right in my code: class Poll(models.Model): # ... def __unicode__(self): return self.question class Choice(models.Model): #

Re: Models Tutorial Django

2010-05-11 Thread Jirka Vejrazka
> class Choice(models.Model): >    poll = models.ForeignKey(Poll) >    choice = models.CharField(max_length=200) >    votes = models.IntegerField() >    def __unicode__(self): >        return self.question > > > I know the structure is wrong. > Any suggestions would be greatly appreciated. Hi,

Models Tutorial Django

2010-05-11 Thread HelloWorld
Hi everybody I have to excuse myself for the newbie question which is following now: Now I am doing the Poll/Models Tutorial on this page http://docs.djangoproject.com/en/dev/intro/tutorial01/ and I am stuck at this point: Wait a minute. is, utterly, an unhelpful representation of this object