1from django.db import models
2# Create your models here.
3
4class Contact(models.Model):
5 name = models.CharField(max_length=50)
6 email = models.CharField(max_length=50)
7 contact = models.CharField(max_length=50)
8 content = models.TextField()
9 def __str__(self):
10 return self.name + ' ' + self.email
1from django.db import models
2
3
4class Question(models.Model):
5 question_text = models.CharField(max_length=200)
6 pub_date = models.DateTimeField('date published')
7
8
9class Choice(models.Model):
10 question = models.ForeignKey(Question, on_delete=models.CASCADE)
11 choice_text = models.CharField(max_length=200)
12 votes = models.IntegerField(default=0)
13