diff --git a/apps/course/migrations/0011_auto_20180129_1527.py b/apps/course/migrations/0011_auto_20180129_1527.py new file mode 100644 index 00000000..c2214936 --- /dev/null +++ b/apps/course/migrations/0011_auto_20180129_1527.py @@ -0,0 +1,28 @@ +# Generated by Django 2.0.1 on 2018-01-29 15:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('course', '0010_auto_20180129_1501'), + ] + + operations = [ + migrations.AlterField( + model_name='course', + name='from_author', + field=models.TextField(blank=True, default='', null=True, verbose_name='От автора'), + ), + migrations.AlterField( + model_name='course', + name='likes', + field=models.ManyToManyField(blank=True, to='course.Like'), + ), + migrations.AlterField( + model_name='course', + name='materials', + field=models.ManyToManyField(blank=True, to='course.Material'), + ), + ] diff --git a/apps/course/models.py b/apps/course/models.py index 705d3eef..f8cfab87 100644 --- a/apps/course/models.py +++ b/apps/course/models.py @@ -24,7 +24,7 @@ class Course(models.Model): author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) title = models.CharField('Название курса', max_length=100) short_description = models.TextField('Краткое описание курса') - from_author = models.TextField('От автора', default='') + from_author = models.TextField('От автора', default='', null=True, blank=True) cover = models.ImageField('Фон курса', upload_to='courses') price = models.DecimalField('Цена курса', help_text='Если цены нету, то курс бесплатный', max_digits=10, decimal_places=2, null=True, blank=True) is_infinite = models.BooleanField(default=False) @@ -34,8 +34,8 @@ class Course(models.Model): is_featured = models.BooleanField(default=False) url = models.URLField('Ссылка', default='') status = models.PositiveSmallIntegerField('Статус', default=0, choices=STATUS_CHOICES) - likes = models.ManyToManyField(Like) - materials = models.ManyToManyField('Material') + likes = models.ManyToManyField(Like, blank=True) + materials = models.ManyToManyField('Material', blank=True) created_at = models.DateTimeField(auto_now_add=True) update_at = models.DateTimeField(auto_now=True)