Skip to content

Instantly share code, notes, and snippets.

@roosnic1
Created July 22, 2020 15:25
Show Gist options
  • Save roosnic1/7eb4ea0ddfc47c476e235f079328caf2 to your computer and use it in GitHub Desktop.
Save roosnic1/7eb4ea0ddfc47c476e235f079328caf2 to your computer and use it in GitHub Desktop.
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)
INSTALLED_APPS = [
'app.apps.AppConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment