Ejemplo n.º 1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('content', models.TextField()),
                ('image', models.ImageField(blank=True, upload_to=articles.models.articles_image_path)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('like_users', models.ManyToManyField(blank=True, related_name='like_articles', to=settings.AUTH_USER_MODEL)),
                ('recommend_users', models.ManyToManyField(blank=True, related_name='recommend_articles', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=200)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='articles.Article')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('tags', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('is_active', models.BooleanField(default=True)),
                ('video', models.FileField(blank=True, null=True, storage=cloudinary_storage.storage.VideoMediaCloudinaryStorage(), upload_to=articles.models.upload_video_to, validators=[cloudinary_storage.validators.validate_video])),
                ('cover', models.ImageField(blank=True, null=True, storage=cloudinary_storage.storage.MediaCloudinaryStorage(), upload_to=articles.models.upload_image_to)),
                ('title', models.CharField(max_length=255, unique=True)),
                ('description', models.TextField()),
                ('content', martor.models.MartorField()),
                ('keywords', models.CharField(default='プログラミング', max_length=255, verbose_name='記事のキーワード')),
                ('publish_at', models.DateTimeField(blank=True, null=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('related_articles', models.ManyToManyField(blank=True, related_name='_article_related_articles_+', to='articles.Article', verbose_name='related articles')),
                ('tags', models.ManyToManyField(blank=True, to='tags.Tag')),
            ],
            options={
                'ordering': ['-publish_at', '-timestamp', '-updated'],
            },
        ),
    ]
Ejemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        ('articles', '0005_auto_20180625_1539'),
    ]

    operations = [
        migrations.AddField(
            model_name='image',
            name='tags',
            field=models.ManyToManyField(to='articles.Tag'),
        ),
        migrations.AddField(
            model_name='image',
            name='updated_at',
            field=models.DateTimeField(auto_now=True, null=True),
        ),
        migrations.AlterField(
            model_name='image',
            name='image',
            field=models.ImageField(blank=True,
                                    null=True,
                                    upload_to=articles.models.filename),
        ),
    ]
Ejemplo n.º 4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('tagging', '0003_adapt_max_tag_length'),
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='AdvUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('vk_url', models.URLField(blank=True, default='', verbose_name='ВКонтакте')),
                ('fb_url', models.URLField(blank=True, default='', verbose_name='Facebook')),
                ('tw_url', models.URLField(blank=True, default='', verbose_name='Twitter')),
                ('ok_url', models.URLField(blank=True, default='', verbose_name='Одноклассники')),
                ('account_image', models.ImageField(blank=True, help_text='Лучше всего подобрать картинку с соотношением сторон 4:3.', null=True, upload_to=articles.models.get_image_path, verbose_name='Изображение профиля')),
                ('account_image_url', models.URLField(blank=True, default='', help_text='Вы можете либо загрузить картинку, либо вставить ссылку на нее.', verbose_name='Ссылка на изображение профиля')),
                ('country', django_countries.fields.CountryField(blank=True, max_length=2, null=True, verbose_name='Страна')),
                ('city', models.CharField(blank=True, max_length=50, null=True, verbose_name='Город')),
                ('bdate', models.DateField(blank=True, null=True, verbose_name='Дата рождения')),
                ('rating', models.IntegerField(default=0, verbose_name='Рейтинг')),
                ('is_activated', models.BooleanField(db_index=True, default=True, help_text='Пользователю было отправлено письмо на почту с ссылкой для активации аккаунта.', verbose_name='Активирован?')),
                ('send_messages', models.BooleanField(default=True, verbose_name='Присылать сообщения о новых комментариях?')),
            ],
            options={
                'verbose_name': 'Пользователь',
                'verbose_name_plural': 'Пользователи',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, default=None, max_length=20, unique=True, verbose_name='Название')),
                ('order', models.SmallIntegerField(db_index=True, default=0, verbose_name='Порядок')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
                'ordering': ('order', 'name'),
            },
        ),
        migrations.CreateModel(
            name='Gender',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, default=None, max_length=20, unique=True, verbose_name='Название')),
                ('one_letter_name', models.CharField(default=None, help_text='Используется в коде.', max_length=1, unique=True, verbose_name='Название пола в одну букву')),
            ],
            options={
                'verbose_name': 'Гендер',
                'verbose_name_plural': 'Гендеры',
            },
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(help_text='Введите до 100 символов.', max_length=100, verbose_name='Название статьи')),
                ('content', models.TextField(verbose_name='Содержание')),
                ('image', models.ImageField(blank=True, help_text='Изображение на плитке на главной странице.\n                              Это поле проверяется первым.\n                              Если файл отсутствует - получает картинку по ссылке (ниже).', null=True, upload_to=articles.models.get_image_path, verbose_name='Превью')),
                ('image_url', models.TextField(blank=True, help_text='Изображение на плитке на главной странице.', null=True, verbose_name='Ссылка на изображение')),
                ('card_text', models.TextField(blank=True, help_text='Введите до 200 символов.', max_length=200, null=True, verbose_name='Аннотация')),
                ('tags', tagging_autocomplete_new.models.TagAutocompleteField(blank=True, max_length=255)),
                ('total_rating', models.IntegerField(default=0, help_text='Всего баллов, полученных от пользователей', verbose_name='Всего баллов')),
                ('rating', models.FloatField(default=0, help_text='Текущий рейтинг в 5-ти балльной шкале', max_length=1, verbose_name='Текущий рейтинг')),
                ('views', models.IntegerField(default=0, verbose_name='Просмотры')),
                ('is_active', models.BooleanField(default=False, verbose_name='Прошла ли модерацию?')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Опубликовано')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Автор')),
                ('category', models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='articles.Category', verbose_name='Категория')),
                ('rated_users', models.ManyToManyField(blank=True, related_name='rated_users', to=settings.AUTH_USER_MODEL, verbose_name='Проголосовавшие пользователи')),
                ('viewed_users', models.ManyToManyField(blank=True, related_name='viewed_users', to=settings.AUTH_USER_MODEL, verbose_name='Пользователи, читавшие статью')),
            ],
            options={
                'verbose_name': 'Статья',
                'verbose_name_plural': 'Статьи',
            },
        ),
        migrations.AddField(
            model_name='advuser',
            name='cat_subscriptions',
            field=models.ManyToManyField(blank=True, related_name='cat_subscriptions', to='articles.Category', verbose_name='Подписки на категории'),
        ),
        migrations.AddField(
            model_name='advuser',
            name='gender',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, to='articles.Gender', verbose_name='Пол'),
        ),
        migrations.AddField(
            model_name='advuser',
            name='groups',
            field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='advuser',
            name='tags_subscriptions',
            field=models.ManyToManyField(blank=True, related_name='tags_subscriptions', to='tagging.Tag', verbose_name='Подписки на теги'),
        ),
        migrations.AddField(
            model_name='advuser',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
        migrations.AddField(
            model_name='advuser',
            name='user_subscriptions',
            field=models.ManyToManyField(blank=True, related_name='_advuser_user_subscriptions_+', to=settings.AUTH_USER_MODEL, verbose_name='Подписки на пользователей'),
        ),
    ]
Ejemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('image',
                 models.ImageField(
                     blank=True,
                     default='images/authors/default.png',
                     null=True,
                     upload_to='images/authors/%Y/%m/%d/D12g0grtT_OIq0OdQouRtA/'
                 )),
                ('cropping',
                 image_cropping.fields.ImageRatioField(
                     'image',
                     '200x200',
                     adapt_rotation=False,
                     allow_fullsize=False,
                     free_crop=False,
                     help_text=None,
                     hide_image_field=False,
                     size_warning=False,
                     verbose_name='cropping')),
                ('name', models.TextField(max_length=200, unique=True)),
                ('description', models.TextField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('image',
                 models.ImageField(
                     blank=True,
                     default='images/categories/default.png',
                     null=True,
                     upload_to=
                     'images/categories/%Y/%m/%d/hLIc1dkARIuonUgMLNllNA/')),
                ('cropping',
                 image_cropping.fields.ImageRatioField(
                     'image',
                     '400x200',
                     adapt_rotation=False,
                     allow_fullsize=False,
                     free_crop=False,
                     help_text=None,
                     hide_image_field=False,
                     size_warning=False,
                     verbose_name='cropping')),
                ('name', models.TextField(max_length=200, unique=True)),
                ('description', models.TextField(max_length=200)),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Feature_Request',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=250)),
                ('subject', models.CharField(max_length=100)),
                ('description', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='FeatureRequests',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=250)),
                ('subject', models.CharField(max_length=1000)),
                ('description', models.TextField()),
                ('created_on', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'FeatureRequest',
                'verbose_name_plural': 'FeatureRequests',
            },
        ),
        migrations.CreateModel(
            name='GainerLoser',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('currency_name', models.CharField(max_length=100)),
                ('currency_symbol', models.CharField(max_length=100)),
                ('percentage_change', models.CharField(max_length=100)),
                ('currency_change', models.CharField(max_length=100)),
                ('category', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Subscriber',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('subscrib_email', models.EmailField(max_length=250)),
                ('news_email', models.EmailField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='Subscribers',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('email', models.EmailField(max_length=250)),
                ('source', models.CharField(max_length=500)),
            ],
            options={
                'verbose_name': 'Subscriber',
                'verbose_name_plural': 'Subscribers',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.TextField(max_length=200, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('heading', models.TextField(max_length=2000)),
                ('image',
                 models.ImageField(
                     default='images/articles/default.png',
                     upload_to=
                     'images/articles/%Y/%m/%d/yV-Y1K4fTHOnQIrTKbQ92g/')),
                ('cropping',
                 image_cropping.fields.ImageRatioField(
                     'image',
                     '700x500',
                     adapt_rotation=False,
                     allow_fullsize=False,
                     free_crop=False,
                     help_text=None,
                     hide_image_field=False,
                     size_warning=False,
                     verbose_name='cropping')),
                ('description', models.TextField()),
                ('content', froala_editor.fields.FroalaField()),
                ('date',
                 models.DateField(default=articles.models.return_date_time)),
                ('priority', models.IntegerField(default=0)),
                ('featured', models.BooleanField(default=False)),
                ('link', models.TextField(default=None, null=True)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='articles.author')),
                ('categories', models.ManyToManyField(to='articles.Category')),
                ('tags', models.ManyToManyField(to='articles.Tag')),
            ],
        ),
    ]
Ejemplo n.º 6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Feed',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.CharField(max_length=140)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('like_users',
                 models.ManyToManyField(blank=True,
                                        related_name='like_feeds',
                                        to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='FeedImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 imagekit.models.fields.ProcessedImageField(
                     upload_to=articles.models.image_path)),
                ('feed',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='articles.Feed')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='feed',
            name='tags',
            field=models.ManyToManyField(related_name='tag_feeds',
                                         to='articles.Tag'),
        ),
        migrations.AddField(
            model_name='feed',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.CharField(max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('feed',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='articles.Feed')),
                ('like_users',
                 models.ManyToManyField(blank=True,
                                        related_name='like_comments',
                                        to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-id'],
            },
        ),
    ]
Ejemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Articles',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(db_index=True,
                                  max_length=300,
                                  verbose_name='Название статьи')),
                ('slug',
                 models.SlugField(max_length=300,
                                  unique=True,
                                  verbose_name='Ссылка')),
                ('body',
                 ckeditor.fields.RichTextField(blank=True,
                                               db_index=True,
                                               verbose_name='Описание')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('desc_for_find',
                 models.TextField(blank=True,
                                  db_index=True,
                                  verbose_name='Описание для поиска')),
                ('keywords',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='Кейвордс')),
                ('img_file',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=articles.models.generate_filename_jpg,
                     verbose_name='IMG')),
                ('attribution',
                 models.CharField(db_index=True,
                                  default=' ',
                                  max_length=300,
                                  verbose_name='Ссылка на источник')),
            ],
            options={
                'verbose_name': 'Статья',
                'verbose_name_plural': 'Статьи',
                'ordering': ['-created'],
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(db_index=True,
                                  max_length=200,
                                  verbose_name='Категория')),
                ('slug',
                 models.SlugField(max_length=200,
                                  unique=True,
                                  verbose_name='Ссылка')),
                ('desc_for_find',
                 models.TextField(blank=True,
                                  db_index=True,
                                  verbose_name='Описание для поиска')),
                ('keywords',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='Кейвордс')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.CreateModel(
            name='Comments',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment_text',
                 models.TextField(verbose_name='Добавить комментарий')),
                ('comment_created', models.DateTimeField(auto_now_add=True)),
                ('comment_article',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='articles.Articles')),
                ('comment_author',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Комментарий',
                'verbose_name_plural': 'Комментарии',
            },
        ),
        migrations.AddField(
            model_name='articles',
            name='category',
            field=models.ManyToManyField(blank=True,
                                         related_name='articles',
                                         to='articles.Category',
                                         verbose_name='Категория'),
        ),
    ]
Ejemplo n.º 8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('is_featured', models.BooleanField(default=False)),
                ('status', models.CharField(choices=[('draft', 'Draft'), ('public', 'Public')], default='draft', max_length=20)),
                ('publish', models.DateTimeField(default=articles.models.default_start_time)),
                ('title', models.CharField(max_length=280)),
                ('slug', models.SlugField(blank=True, default='', max_length=280, unique=True)),
                ('content', ckeditor.fields.RichTextField()),
                ('description', models.TextField(blank=True, null=True)),
                ('seo_title', models.CharField(blank=True, max_length=70, null=True)),
                ('seo_description', models.CharField(blank=True, max_length=160, null=True)),
                ('post_image', models.ImageField(blank=True, null=True, upload_to='post_images/')),
                ('post_thumb', models.ImageField(blank=True, null=True, upload_to='post_thumbs/')),
                ('post_image_alt', models.CharField(blank=True, max_length=280, null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(blank=True, null=True, on_delete='SET_DEFAULT', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Post',
                'verbose_name_plural': 'Posts',
                'db_table': 'post',
                'ordering': ('-publish',),
                'get_latest_by': 'date',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=100)),
                ('slug', models.SlugField(unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('seo_title', models.CharField(blank=True, max_length=60, null=True)),
                ('seo_description', models.CharField(blank=True, max_length=165, null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Tag',
                'verbose_name_plural': 'Tags',
                'db_table': 'tag',
                'ordering': ('title',),
            },
        ),
        migrations.AddField(
            model_name='post',
            name='tags',
            field=models.ManyToManyField(blank=True, to='articles.Tag'),
        ),
    ]
Ejemplo n.º 9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=200,
                                  verbose_name='Название статьи')),
                ('text', models.TextField(verbose_name='Текст статьи')),
                ('pub_date', models.DateField(verbose_name='Дата добавления')),
            ],
            options={
                'verbose_name': 'Статья',
                'verbose_name_plural': 'Статьи',
            },
        ),
        migrations.CreateModel(
            name='Partner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('full_name', models.CharField(max_length=300, unique=True)),
                ('short_name', models.CharField(max_length=15, unique=True)),
                ('slug', models.SlugField(unique=True)),
                ('icon',
                 models.ImageField(upload_to=articles.models.image_folder)),
            ],
            options={
                'verbose_name': 'Партнер',
                'verbose_name_plural': 'Партнеры',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=30,
                                  verbose_name='Название тега')),
            ],
            options={
                'verbose_name': 'Тег',
                'verbose_name_plural': 'Теги',
            },
        ),
        migrations.AddField(
            model_name='article',
            name='tags',
            field=models.ManyToManyField(to='articles.Tag',
                                         verbose_name='Теги'),
        ),
    ]