Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

polls/models.py

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)
Comment

PREVIOUS NEXT
Code Example
Python :: sparse matrix multiplication in python 
Python :: python string to uppercase 
Python :: create new spreadsheet 
Python :: Syntax of Python Frozenset 
Python :: How To Remove Elements From a Set using remove() function in python 
Python :: immutability in python 
Python :: python list copy 
Python :: concatenate strings and int python 
Python :: array sort in python 
Python :: python int to ascii string 
Python :: what is self 
Python :: iloc[:,0:-1] 
Python :: find position of key in dictionary python 
Python :: string count in python 
Python :: how to read an xml file 
Python :: prompt python 
Python :: github downloader 
Python :: flask page 
Python :: python generators with for 
Python :: class object 
Python :: python range 
Python :: transpose matrix python 
Python :: deactivate pandas warning copy 
Python :: python mark function as no return 
Python :: django creat app return _bootstrap._gcd_import 
Python :: def multiply(a b) a * b 
Python :: python macro ensurepip py3 
Python :: openCV error [WARN:0] terminating async callback 
Python :: while loop choosing numbers 
Python :: how to output varibles in python 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =