Hi Carsten,
Thank you!
I finally understood what's happening.
I should have added choices into each question.
Now, choice_set.all thing is working!
Thank you for your advice!
Nori
On Sunday, February 3, 2019 at 3:20:39 PM UTC-5, Carsten Fuchs wrote:
>
> Well, you're adding choices to q = Questi
Hi Nitin,
Thank you!
I finally understood what you said.
Now working fine. Actually it was working, but I did not understand.
Thank you!
Nori
On Sunday, February 3, 2019 at 11:08:34 AM UTC-5, Nitin Kalmaste wrote:
>
> You have to add Choices for each questions you have created in database
> li
Well, you're adding choices to q = Question.objects.get(pk=1).
But is this also the question you call the view with?
I suggest you add a few more print statements below your existing
print(question)
For example:
print(question.pk)
print(question.choice_set.all())
# Or, a bit mo
You have to add Choices for each questions you have created in database
like the process is same as you used for the questions.
On Sun, Feb 3, 2019, 8:53 PM Atsunori Kaneshige Hi Nitin,
>
> Thank you for your comment.
>
> I did
>
> jango-admin startproject mysite
>
> and cd mysite, then
>
> python
*Here is the codes about choice*
In [27]: q = Question.objects.get(pk=1)
In [28]: q.choice_set.all()
Out[28]:
In [29]: q.choice_set.create(choice_text='Not much',votes=0)
Out[29]:
In [30]: q.choice_set.create(choice_text='The sky',votes=0)
Out[30]:
In [31]: c = q.choice_set.create(c
Hi Carsten,
Sorry, are you talking about Writing Your First App, Part2? The page below?
https://docs.djangoproject.com/en/2.1/intro/tutorial02/
Yeah, when I tried this, there was something wrong.
*I did that again. I copied and pasted my terminal below.*
*seems like migration was successful when
On Sunday, February 3, 2019 at 10:22:56 AM UTC-5, Atsunori Kaneshige wrote:
>
> Hi Nitin,
>
> Thank you for your comment.
>
> I did
>
> jango-admin startproject mysite
>
> and cd mysite, then
>
> python manage.py runserver
>
> and server is working, so I did
>
> opython manage.py startapp polls
Hi Nitin,
Thank you for your comment.
I did
jango-admin startproject mysite
and cd mysite, then
python manage.py runserver
and server is working, so I did
opython manage.py startapp polls
polls app was successfully created, and stopped the server because I wanted
to user postgresql inste
Hi, copy and paste wouldn't actually make you understand Django. Try to
write the code yourself and you see how quickly your understanding grow.
On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige
wrote:
>
> Hi Django users,
>
> I started using Django recently.
> I am followi
Hi Nori,
does the choice actually exist?
Can you find it if you query the choices using the ORM in `./manage.py shell`?
Best regards,
Carsten
Am 03.02.19 um 03:59 schrieb Atsunori Kaneshige:
> Hi Django users,
>
> I started using Django recently.
> I am following the official Django tutorial.
Have you migrated database and added any question there?
On Sun, Feb 3, 2019, 8:39 AM Atsunori Kaneshige Oh, one note is that I am using postgresql.
> everything else except vote function in views.py seems working.
>
> Sorry, any help would be really appreciated!
>
> Nori
>
> On Saturday, Februar
Oh, one note is that I am using postgresql.
everything else except vote function in views.py seems working.
Sorry, any help would be really appreciated!
Nori
On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige
wrote:
>
> Hi Django users,
>
> I started using Django recently.
>
12 matches
Mail list logo