Remove all migration files and unused CSS files from the project.
This commit is contained in:
parent
440f5a7df4
commit
16897b6010
28 changed files with 265 additions and 2278 deletions
|
|
@ -1,35 +0,0 @@
|
|||
# Generated by Django 5.0.6 on 2024-06-10 16:02
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Course',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=200)),
|
||||
('content', models.TextField()),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Lesson',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=200)),
|
||||
('content', models.TextField()),
|
||||
('order', models.PositiveIntegerField()),
|
||||
('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lecons', to='courses.course')),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 5.0.6 on 2024-06-10 17:14
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('courses', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='course',
|
||||
name='thumbnail',
|
||||
field=models.ImageField(default='default.jpg', upload_to='thumbnails/courses/'),
|
||||
),
|
||||
]
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# Generated by Django 5.0.6 on 2024-06-11 07:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('courses', '0002_course_thumbnail'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='lesson',
|
||||
name='author',
|
||||
field=models.CharField(default=None, max_length=100),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='course',
|
||||
name='thumbnail',
|
||||
field=models.ImageField(default='default.jpg', upload_to='static/uploads/thumbnails/courses/'),
|
||||
),
|
||||
]
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# Generated by Django 5.0.6 on 2024-06-11 08:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('courses', '0003_lesson_author_alter_course_thumbnail'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='lesson',
|
||||
name='author',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='course',
|
||||
name='author',
|
||||
field=models.CharField(default='Anthony Violet', max_length=100),
|
||||
),
|
||||
]
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 4.2.17 on 2024-12-14 10:12
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('courses', '0004_remove_lesson_author_course_author'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='course',
|
||||
old_name='author',
|
||||
new_name='old_author',
|
||||
),
|
||||
]
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Generated by Django 4.2.17 on 2024-12-14 10:13
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('courses', '0005_rename_author_course_old_author'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='course',
|
||||
name='author',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
]
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Generated by Django 4.2.17 on 2024-12-14 10:13
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
def convert_old_authors(apps, schema_editor):
|
||||
Course = apps.get_model('courses', 'Course')
|
||||
User = apps.get_model('auth', 'User')
|
||||
default_user = User.objects.get(id=1)
|
||||
for course in Course.objects.all():
|
||||
course.author = default_user
|
||||
course.save()
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('courses', '0006_course_author'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(convert_old_authors),
|
||||
]
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# Generated by Django 4.2.17 on 2024-12-14 10:16
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('courses', '0007_convert_old_authors'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='course',
|
||||
name='old_author',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='course',
|
||||
name='author',
|
||||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
|
|
@ -1,22 +1,37 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils.html import escape
|
||||
|
||||
class Course(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
content = models.TextField()
|
||||
slug = models.SlugField(unique=True)
|
||||
tags = models.CharField(max_length=200)
|
||||
author = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
thumbnail = models.ImageField(upload_to='static/uploads/thumbnails/courses/', default='default.jpg')
|
||||
thumbnail = models.ImageField(upload_to='thumbnails/courses/', default='default.jpg')
|
||||
description = models.TextField()
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
enable = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Lesson(models.Model):
|
||||
course_id = models.ForeignKey(Course, on_delete=models.CASCADE, related_name='lecons')
|
||||
class Module(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
slug = models.SlugField()
|
||||
course = models.ForeignKey(Course, on_delete=models.CASCADE, related_name='modules')
|
||||
description = models.TextField()
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
enable = models.BooleanField(default=True)
|
||||
order = models.PositiveIntegerField()
|
||||
|
||||
class Lesson(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
slug = models.SlugField()
|
||||
module = models.ForeignKey(Module, on_delete=models.CASCADE, related_name='lessons')
|
||||
content = models.TextField()
|
||||
video_id = models.CharField(max_length=200, blank=True)
|
||||
is_premium = models.BooleanField(default=False)
|
||||
order = models.PositiveIntegerField()
|
||||
|
||||
def clean(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue