class Migration(migrations.Migration):

    dependencies = [
        ('articles', '0001_initial'),
    ]

    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=250,
                                           verbose_name='Title')),
                ('writer',
                 models.CharField(max_length=100, verbose_name='Writer')),
                ('genre', models.CharField(max_length=50,
                                           verbose_name='Genre')),
                ('published_on',
                 models.DateField(default=django.utils.timezone.now,
                                  verbose_name='Published on')),
                ('modified_on', models.DateField(auto_now=True,
                                                 verbose_name='')),
                ('title_image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=articles.models.upload_image,
                                   verbose_name='Title Image')),
            ],
        ),
        migrations.DeleteModel(name='Blog_page', ),
    ]
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.TextField()),
                ('abstract', models.TextField()),
                #('authors', djongo.models.fields.ArrayModelField(model_container=articles.models.Author)),
                ('publisher', models.TextField()),
                ('journal', models.TextField()),
                ('datepublished', models.DateField()),
                ('source_link', models.URLField()),
                ('isopenaccess', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
            ],
        ),
    ]
Esempio n. 3
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=250, verbose_name='Название')),
                ('text', tinymce.models.HTMLField()),
                ('published', models.BooleanField(default=True, verbose_name='Активно')),
                ('created_date', models.DateField(default=datetime.date.today, verbose_name='Дата создания')),
                ('image', models.ImageField(upload_to=articles.models.Article.get_picture_url, verbose_name='Изображение')),
            ],
            options={
                'verbose_name': 'Статья',
                'verbose_name_plural': 'Статьи',
            },
        ),
    ]
Esempio 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='Подписки на пользователей'),
        ),
    ]
Esempio 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')),
            ],
        ),
    ]
Esempio n. 6
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='Теги'),
        ),
    ]
Esempio n. 7
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')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('title', models.CharField(max_length=250)),
                ('hero',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=articles.models.article_image_path)),
                ('content', models.TextField()),
                ('slug',
                 django_extensions.db.fields.AutoSlugField(
                     blank=True,
                     editable=False,
                     populate_from=['publish_date', 'title'])),
                ('publish_date', models.DateField()),
            ],
            options={
                'ordering': ('-modified', '-created'),
                'get_latest_by': 'modified',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('avatar',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=articles.models.author_avatar_path)),
                ('slug',
                 django_extensions.db.fields.AutoSlugField(
                     blank=True,
                     editable=False,
                     populate_from=['user__first_name', 'user__last_name'])),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('slug',
                 django_extensions.db.fields.AutoSlugField(
                     blank=True, editable=False, populate_from='name')),
            ],
            options={
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.AddField(
            model_name='article',
            name='author',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='articles.Author'),
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='articles.Category'),
        ),
    ]