Lin*_*nux 0 python django django-models python-3.x
嗨,我正在尝试生成迁移,但没有在数据库中创建所有字段。下面是我的代码。
from django.db import models
class News(models.Model):
author = models.CharField(max_length = 100),
content = models.CharField(max_length= 100),
description = models.TextField(default= "")
def __str__(self):
return self.author
class Meta:
db_table = "news"
class SportNews(models.Model):
author = models.CharField(max_length = 100),
content = models.CharField(max_length = 100),
description = models.TextField(default = "")
def __str__(self):
return self.author
class Meta:
db_table = "sports_news"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
101 次 |
| 最近记录: |