新增自学模块
This commit is contained in:
@@ -2,8 +2,15 @@ from django.db import models
|
||||
from account.models import User
|
||||
|
||||
class Tutorial(models.Model):
|
||||
TYPE_CHOICES = [
|
||||
('python', 'Python'),
|
||||
('c', 'C'),
|
||||
]
|
||||
|
||||
title = models.CharField(max_length=128)
|
||||
content = models.TextField()
|
||||
code = models.TextField(default="")
|
||||
type = models.CharField(max_length=10, choices=TYPE_CHOICES, default='python')
|
||||
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
Reference in New Issue
Block a user