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
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):
>
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,
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):
#
> 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,
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
6 matches
Mail list logo