Monday, January 14, 2019

Re: DJANGO-POLLS

I am glad to be helpful. Your welcome!

On Monday, 14 January 2019 15:48:00 UTC+5:45, Tarık Kantar wrote:
THANK YOU VERY MUCH İT WORKS! :)

Kuber Sodari <ksod...@gmail.com>, 14 Oca 2019 Pzt, 10:59 tarihinde şunu yazdı:
I see the problem is with 
class Choice(models.Model)
     question = models.ForeignKey(Question) 

Update it as this
class Choice(models.Model)
     question = models.ForeignKey(Question, on_delete=models.CASCADE

CASCADE: What this does it, when you delete the related object of Question, it will also delete the Choice object 
if you don't want that and when deleting Question object, if you want the choice object should remain even after then simple do this instead of CASCADE
models.SET_NULL

On Monday, 14 January 2019 15:38:09 UTC+5:45, tarikk...@gmail.com wrote:
This my screenshut of models.py

14 Ocak 2019 Pazartesi 10:43:32 UTC+1 tarihinde tarikk...@gmail.com yazdı:
Hi everyone!
Could you please help me why I cant see this part below when I run this command, python manage.py makemigrations polls,?

<<<<Migrations for 'polls':
  0001_initial.py:      - Create model Question      - Create model Choice      - Add field question to choice>>>>>>>>>

I saw just that screen shut.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/17fde7c1-fd2c-4d4a-92ec-058bc448b298%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Tarık Kantar

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cb60ed70-172f-40f8-87fd-3c1c1bcfd983%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment