LIL-22. Add index for title & short_description fields Course model

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 19510fd3c1
commit 73030aedb3
  1. 23
      apps/course/migrations/0019_auto_20180130_1630.py
  2. 4
      apps/course/models.py

@ -0,0 +1,23 @@
# Generated by Django 2.0.1 on 2018-01-30 16:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0018_auto_20180130_1248'),
]
operations = [
migrations.AlterField(
model_name='course',
name='short_description',
field=models.TextField(db_index=True, verbose_name='Краткое описание курса'),
),
migrations.AlterField(
model_name='course',
name='title',
field=models.CharField(db_index=True, max_length=100, verbose_name='Название курса'),
),
]

@ -24,8 +24,8 @@ class Course(models.Model):
(2, 'Archived'), (2, 'Archived'),
) )
author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True)
title = models.CharField('Название курса', max_length=100) title = models.CharField('Название курса', max_length=100, db_index=True)
short_description = models.TextField('Краткое описание курса') short_description = models.TextField('Краткое описание курса', db_index=True)
from_author = models.TextField('От автора', default='', null=True, blank=True) from_author = models.TextField('От автора', default='', null=True, blank=True)
cover = models.ImageField('Фон курса', upload_to='courses') cover = models.ImageField('Фон курса', upload_to='courses')
price = models.DecimalField('Цена курса', help_text='Если цены нету, то курс бесплатный', max_digits=10, decimal_places=2, null=True, blank=True) price = models.DecimalField('Цена курса', help_text='Если цены нету, то курс бесплатный', max_digits=10, decimal_places=2, null=True, blank=True)

Loading…
Cancel
Save