parent
d1ba212815
commit
8c6eea5a9c
5 changed files with 101 additions and 1 deletions
@ -0,0 +1,29 @@ |
|||||||
|
# Generated by Django 2.0.1 on 2018-01-29 14:07 |
||||||
|
|
||||||
|
from django.db import migrations, models |
||||||
|
import django.db.models.deletion |
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration): |
||||||
|
|
||||||
|
dependencies = [ |
||||||
|
('course', '0005_course_from_author'), |
||||||
|
] |
||||||
|
|
||||||
|
operations = [ |
||||||
|
migrations.CreateModel( |
||||||
|
name='Lesson', |
||||||
|
fields=[ |
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||||
|
('title', models.CharField(max_length=100, verbose_name='Название урока')), |
||||||
|
('short_description', models.TextField(verbose_name='Краткое описание курса')), |
||||||
|
('cover', models.ImageField(upload_to='lessons', verbose_name='Фон урока')), |
||||||
|
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lessons', to='course.Course')), |
||||||
|
], |
||||||
|
options={ |
||||||
|
'verbose_name': 'Урок', |
||||||
|
'verbose_name_plural': 'Уроки', |
||||||
|
'ordering': ('-title',), |
||||||
|
}, |
||||||
|
), |
||||||
|
] |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
# Generated by Django 2.0.1 on 2018-01-29 14:33 |
||||||
|
|
||||||
|
from django.db import migrations |
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration): |
||||||
|
|
||||||
|
dependencies = [ |
||||||
|
('course', '0006_lesson'), |
||||||
|
] |
||||||
|
|
||||||
|
operations = [ |
||||||
|
migrations.AlterModelOptions( |
||||||
|
name='lesson', |
||||||
|
options={'ordering': ('title',), 'verbose_name': 'Урок', 'verbose_name_plural': 'Уроки'}, |
||||||
|
), |
||||||
|
] |
||||||
@ -0,0 +1,25 @@ |
|||||||
|
# Generated by Django 2.0.1 on 2018-01-29 14:36 |
||||||
|
|
||||||
|
from django.db import migrations, models |
||||||
|
import django.utils.timezone |
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration): |
||||||
|
|
||||||
|
dependencies = [ |
||||||
|
('course', '0007_auto_20180129_1433'), |
||||||
|
] |
||||||
|
|
||||||
|
operations = [ |
||||||
|
migrations.AddField( |
||||||
|
model_name='lesson', |
||||||
|
name='created_at', |
||||||
|
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), |
||||||
|
preserve_default=False, |
||||||
|
), |
||||||
|
migrations.AddField( |
||||||
|
model_name='lesson', |
||||||
|
name='update_at', |
||||||
|
field=models.DateTimeField(auto_now=True), |
||||||
|
), |
||||||
|
] |
||||||
Loading…
Reference in new issue