Can anyone please explain the below code???

68 views
Skip to first unread message

utpalbr...@gmail.com

unread,
Oct 6, 2017, 8:37:19 AM10/6/17
to Django developers (Contributions to Django itself)
from django.db import models


class Question(models.Model):
    question_text = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')


class Choice(models.Model):
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)

My question----
1.What is models.Models?
2.What are the attributes of models?
3.What are the attributes of Models?

Bruno Ribeiro da Silva

unread,
Oct 6, 2017, 8:44:54 AM10/6/17
to django-d...@googlegroups.com
Wrong list, this is for development related only.

I suggest you read django's documentation https://docs.djangoproject.com/en/1.11/

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ac101a4b-4fb9-4d7c-abee-effbd61062d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Bruno Ribeiro da Silva
Python Dev and Homebrewer!
Reply all
Reply to author
Forward
0 new messages