📜  在 django 中创建模型 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:29.048000             🧑  作者: Mango

代码示例1
from django.db import models
# Create your models here.

class Contact(models.Model):
    name = models.CharField(max_length=50)
    email = models.CharField(max_length=50)
    contact = models.CharField(max_length=50)
    content = models.TextField()
    def __str__(self):
        return self.name + ' ' + self.email