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
3class Person(models.Model):
4 """
5 This class creates a new table with
6 the name of your application and that class name.
7 The fully qualified name of the table
8 will be "appName_className".
9 Also, two fields with data type char will be
10 created: first_name and last_name.
11 """
12 first_name = models.CharField(max_length=30)
13 last_name = models.CharField(max_length=30)
14