新增自学模块

This commit is contained in:
2025-06-15 14:41:01 +08:00
parent e752d9e7b7
commit c0b7c29429
9 changed files with 210 additions and 45 deletions

View File

@@ -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)