You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
411 B

2 years ago
from django.db import models
from django.utils import timezone
2 years ago
# 博客文章 model
class Article(models.Model):
# 标题
title = models.CharField(max_length=100)
# 正文
body = models.TextField()
# 创建时间
created = models.DateTimeField(default=timezone.now)
# 更新时间
updated = models.DateTimeField(auto_now=True)
def __str__(self):
return self.title