class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0005_auto_20170511_1537'),
    ]

    operations = [
        migrations.AddField(
            model_name='theme',
            name='height_field',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='theme',
            name='image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=blog.models.upload_location,
                                    verbose_name='Изображение',
                                    width_field='width_field'),
        ),
        migrations.AddField(
            model_name='theme',
            name='slug',
            field=models.SlugField(default='', unique=True),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='theme',
            name='width_field',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='unit',
            name='height_field',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='unit',
            name='image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=blog.models.upload_location,
                                    verbose_name='Изображение',
                                    width_field='width_field'),
        ),
        migrations.AddField(
            model_name='unit',
            name='slug',
            field=models.SlugField(default='', unique=True),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='unit',
            name='width_field',
            field=models.IntegerField(default=0),
        ),
    ]
Example #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('slug', models.SlugField(unique=True)),
                ('desc', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=300)),
                ('slug', models.SlugField(unique=True)),
                ('date_created', models.DateTimeField(auto_now=True)),
                ('img', models.ImageField(upload_to=blog.models.post_upload_handler)),
                ('content', models.TextField()),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Category')),
            ],
            options={
                'verbose_name_plural': 'Posts',
            },
        ),
    ]
Example #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=35)),
                ('content', models.TextField(max_length=500)),
                ('heart', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('image',
                 models.ImageField(upload_to=blog.models.tag_upload_path)),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('highlights', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('description', models.TextField(default='', max_length=500)),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('image',
                 models.ImageField(upload_to=blog.models.post_upload_path)),
                ('content', models.TextField(default='', max_length=65535)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('highlights', models.IntegerField(default=0)),
                ('heart', models.IntegerField(default=0)),
                ('tag',
                 models.ManyToManyField(related_name='posts', to='blog.Tag')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('slug',
                 models.SlugField(max_length=150,
                                  unique=True,
                                  verbose_name='Url')),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=250)),
                ('slug',
                 models.SlugField(max_length=250,
                                  unique_for_date='created_at')),
                ('image',
                 models.ImageField(upload_to=blog.models.get_file_path)),
                ('content', froala_editor.fields.FroalaField(blank=True)),
                ('created_at',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Published')),
                ('category',
                 models.ManyToManyField(related_name='posts',
                                        to='blog.Category')),
            ],
            options={
                'verbose_name': 'Post',
                'verbose_name_plural': 'Posts',
                'ordering': ['-created_at'],
            },
        ),
    ]
Example #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=50,
                                  verbose_name='Название курса')),
                ('slug', models.SlugField(blank=True, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=50,
                                  verbose_name='Название поста')),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('image',
                 models.ImageField(height_field='height_field',
                                   upload_to=blog.models.upload_location,
                                   verbose_name='Фото продукта',
                                   width_field='width_field')),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('content', models.TextField()),
                ('published_date',
                 models.DateTimeField(auto_now_add=True,
                                      db_index=True,
                                      verbose_name='Опубликовано')),
                ('views',
                 models.IntegerField(default=0, verbose_name='Просмотры')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='posts',
                                   to='blog.Course')),
            ],
        ),
    ]
Example #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('slug', models.SlugField(max_length=255)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('content', ckeditor.fields.RichTextField(blank=True,
                                                          null=True)),
                ('status',
                 models.CharField(choices=[('published', 'Published'),
                                           ('draft', 'Draft')],
                                  default='draft',
                                  max_length=15)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('cover', models.ImageField(upload_to=blog.models.image_path)),
                ('category',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='blog.Category')),
            ],
        ),
    ]
Example #7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('article_title', models.CharField(max_length=50, unique=True, verbose_name='Назва статті')),
                ('article_text', models.TextField(max_length=5000, verbose_name='Текст статті')),
                ('article_date', models.DateTimeField(auto_now_add=True, verbose_name='Дата створення')),
                ('article_update', models.DateTimeField(auto_now=True, verbose_name='Дата оновлення')),
                ('article_likes', models.IntegerField(default=0, verbose_name='Подобається')),
                ('article_image', models.ImageField(blank=True, height_field='height_field', help_text='Зображення до статті', null=True, upload_to=blog.models.upload_location, verbose_name='Картинки', width_field='width_field')),
                ('width_field', models.IntegerField(default=0, verbose_name='Ширина картинки в пікселях')),
                ('height_field', models.IntegerField(default=0, verbose_name='Висота картинки в пікселях')),
                ('article_slug', models.SlugField(blank='', unique='', verbose_name='Ім`я статті транслітом')),
                ('article_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='articles', to='navigation.Category', verbose_name='Категорія')),
            ],
            options={
                'verbose_name': 'Стаття',
                'verbose_name_plural': 'Статті',
                'db_table': 'articles',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tag_title', models.CharField(max_length=50, verbose_name='Назва тега')),
                ('tag_name', models.SlugField(verbose_name='Ім`я тега транслітом')),
            ],
            options={
                'verbose_name': 'Тег',
                'verbose_name_plural': 'Тегі',
                'db_table': 'tags',
            },
        ),
        migrations.AddField(
            model_name='article',
            name='article_tag',
            field=models.ManyToManyField(related_name='articles', to='blog.Tag', verbose_name='Тегі'),
        ),
    ]
Example #8
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')),
                ('auteur', models.CharField(max_length=40)),
                ('contenu', models.TextField(default='', unique=True)),
                ('date_post', models.DateTimeField(auto_now=True, verbose_name='Date dernière modification')),
                ('titre', models.CharField(max_length=100, unique=True)),
                ('introduction', models.TextField(null=True, unique=True, verbose_name='Intro')),
                ('vue', models.ImageField(default=False, upload_to=blog.models.rename_article_vue, verbose_name='Image du post')),
                ('valide', models.NullBooleanField(default=True)),
                ('slug', models.SlugField()),
            ],
            options={
                'verbose_name': 'Article',
                'verbose_name_plural': 'Articles',
                'ordering': ['categorie', 'date_post'],
            },
        ),
        migrations.CreateModel(
            name='Categorie',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=50, unique=True)),
                ('slug', models.SlugField()),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='blog.Categorie')),
            ],
            options={
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.AddField(
            model_name='article',
            name='categorie',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Categorie'),
        ),
        migrations.AlterUniqueTogether(
            name='categorie',
            unique_together={('slug', 'parent')},
        ),
    ]
Example #9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('taggit', '0002_auto_20150616_2121'),
    ]

    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=125, verbose_name='Название')),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('image', models.ImageField(blank=True, upload_to=blog.models.generate_filename, verbose_name='Фото')),
                ('content', ckeditor_uploader.fields.RichTextUploadingField(blank=True, default='')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
            ],
            options={
                'verbose_name': 'Статья',
                'verbose_name_plural': 'Статьи',
            },
            bases=(models.Model, hitcount.models.HitCountMixin),
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
                ('slug', models.SlugField(blank=True, unique=True)),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Category', verbose_name='Категория'),
        ),
        migrations.AddField(
            model_name='article',
            name='tags',
            field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
        ),
    ]
Example #10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('slug', models.SlugField(unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Menuitem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('url', models.CharField(default='#', max_length=150)),
                ('lft', models.PositiveIntegerField(editable=False)),
                ('rght', models.PositiveIntegerField(editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(editable=False)),
                ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='blog.Menuitem')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(db_index=True, max_length=150)),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('body', ckeditor_uploader.fields.RichTextUploadingField(max_length=3000)),
                ('date_pub', models.DateTimeField(auto_now_add=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to='images/')),
                ('category', models.ManyToManyField(default=blog.models.get_first_category, related_name='posts', to='blog.Category')),
            ],
            options={
                'ordering': ['-date_pub'],
            },
        ),
    ]
Example #11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('author', models.CharField(max_length=20, verbose_name='작성자')),
                ('title', models.CharField(help_text='포스팅 제목을 최대 50자 이내로 입력해주세요.', max_length=50, verbose_name='제목')),
                ('slug', models.SlugField(blank=True, help_text='포스트 제목의 별칭입니다. 한 단어만!', unique=True, verbose_name='Slug')),
                ('content', models.TextField(help_text='포스트 내용', verbose_name='내용')),
                ('description', models.CharField(blank=True, help_text='포스트 내용 한 줄 설명', max_length=100, verbose_name='한 줄 요약')),
                ('tags', models.CharField(blank=True, max_length=100)),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Create Date')),
                ('modify_date', models.DateTimeField(auto_now=True, verbose_name='Modify Date')),
                ('status', models.CharField(choices=[('d', 'Draft'), ('p', 'Published'), ('w', 'Withdrawn'), ('a', 'Another_ex')], max_length=1, verbose_name='상태')),
                ('lnglat', models.CharField(blank=True, help_text='경도, 위도 포맷으로 입력 바람', max_length=40, validators=[blog.models.lnglat_validator])),
            ],
            options={
                'verbose_name_plural': 'posts',
                'verbose_name': 'post',
                'ordering': ('-modify_date',),
                'db_table': 'my_post',
            },
        ),
    ]
Example #12
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BlogModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=200, unique=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('blog_image',
                 models.ImageField(upload_to=blog.models.upload_location)),
                ('description', tinymce.models.HTMLField()),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created_on', ),
            },
        ),
    ]
Example #13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('title', models.CharField(max_length=100, primary_key=True, serialize=False, unique=True)),
                ('author', models.CharField(max_length=100)),
                ('date_posted', models.DateTimeField(auto_now_add=True)),
                ('date_updated', models.DateTimeField(auto_now=True)),
                ('image', models.ImageField(upload_to=blog.models.post_upload_path)),
                ('content', models.TextField(max_length=10000)),
                ('briefing', models.TextField(max_length=1000)),
                ('slug', models.SlugField(max_length=140, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('name', models.CharField(max_length=40, primary_key=True, serialize=False)),
            ],
        ),
        migrations.AddField(
            model_name='post',
            name='tags',
            field=models.ManyToManyField(to='blog.Tag'),
        ),
    ]
Example #14
0
class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0007_auto_20190704_2313'),
    ]

    operations = [
        migrations.AddField(
            model_name='post',
            name='slug',
            field=models.SlugField(default='', editable=False, max_length=120),
        ),
        migrations.AlterField(
            model_name='post',
            name='images',
            field=models.ImageField(blank=True,
                                    null=True,
                                    upload_to=blog.models.generate_image_path),
        ),
        migrations.AlterField(
            model_name='post',
            name='title',
            field=models.CharField(max_length=100),
        ),
    ]
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=120)),
                ('slug', models.SlugField()),
                ('description', models.TextField()),
                ('post', models.TextField()),
                ('mainImage', models.ImageField(blank=True, upload_to=blog.models.main_image_folder)),
                ('date', models.DateTimeField()),
            ],
            options={
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('timestemp', models.DateTimeField(auto_now_add=True)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Article')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Example #16
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('body', models.TextField(max_length=2000)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('is_published', models.BooleanField(default=False)),
                ('image',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=blog.models.post_image_file_path)),
            ],
        ),
    ]
Example #17
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=120)),
                ('slug', models.SlugField(blank=True)),
                ('tag', models.CharField(max_length=30)),
                ('description', models.TextField()),
                ('image', models.ImageField(blank=True, null=True, upload_to=blog.models.upload_image_path)),
                ('created', models.DateField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'category',
                'verbose_name_plural': 'categories',
                'ordering': ('created',),
            },
        ),
    ]
Example #18
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='BlogPost',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('body', models.TextField(max_length=5000)),
                ('image',
                 models.ImageField(upload_to=blog.models.upload_location)),
                ('date_published',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date published')),
                ('date_updated',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='date updated')),
                ('slug', models.SlugField(blank=True, unique=True)),
            ],
        ),
    ]
Example #19
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')),
                ('title', models.CharField(max_length=120)),
                ('slug', models.SlugField(unique=True)),
                ('image', models.ImageField(blank=True, height_field='height_field', null=True, upload_to=blog.models.upload_location, width_field='width_field')),
                ('width_field', models.IntegerField(default=0)),
                ('height_field', models.IntegerField(default=0)),
                ('context', models.TextField()),
                ('draft', models.BooleanField(default=False)),
                ('publish', models.DateField()),
                ('read_time', models.IntegerField(default=0)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='post', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Example #20
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('post_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('post_title', models.CharField(max_length=500)),
                ('post_slug', models.SlugField(max_length=500)),
                ('post_body', models.TextField()),
                ('post_publish',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('post_image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=blog.models.content_file_name)),
                ('post_author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='blog_posts',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0002_auto_20190624_1040'),
    ]

    operations = [
        migrations.AlterField(
            model_name='blog',
            name='slug',
            field=models.SlugField(default='', max_length=200),
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to=blog.models.get_image_filename,
                                   verbose_name='Image')),
                ('blog',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Blog')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0027_auto_20181020_1356'),
    ]

    operations = [
        migrations.AlterField(
            model_name='blog',
            name='body',
            field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, help_text='This is the main content of the blog. You can style the content , put images, videos, code-snippets and a lot more things directly into the editor', null=True),
        ),
        migrations.AlterField(
            model_name='blog',
            name='picture',
            field=models.ImageField(help_text='This picture is the cover image of your blog.', upload_to=blog.models.get_blog_image_upload_path),
        ),
        migrations.AlterField(
            model_name='blog',
            name='short_description',
            field=models.TextField(blank=True, help_text='This is the short description that appears in blog list. (Limit to 500 characters)', max_length=500, null=True),
        ),
        migrations.AlterField(
            model_name='blog',
            name='slug',
            field=models.SlugField(blank=True, help_text='This slug will form the url of your blog. The Url will be blogs/blog/<your username>/<slug>', max_length=60, null=True),
        ),
        migrations.AlterField(
            model_name='blog',
            name='tags',
            field=models.ManyToManyField(blank=True, help_text='Please select relevant tags for your blog. or create a new tag', to='blog.Tag'),
        ),
    ]
Example #23
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BlogData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=20)),
                ('slug', models.SlugField(unique=True)),
                ('image', models.ImageField(blank=True, height_field='height_field', null=True, upload_to=blog.models.upload_location, width_field='width_field')),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('content', models.TextField()),
                ('time_stamp', models.DateTimeField(auto_now_add=True)),
                ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-id', '-time_stamp'],
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        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)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=250)),
                ('image', models.ImageField(default='posts/default.jpg', upload_to=blog.models.upload_to, verbose_name='Image')),
                ('excerpt', models.TextField(null=True)),
                ('content', models.TextField()),
                ('slug', models.SlugField(max_length=250, unique_for_date='published')),
                ('published', models.DateTimeField(default=django.utils.timezone.now)),
                ('status', models.CharField(choices=[('draft', 'Draft'), ('published', 'Published')], default='published', max_length=10)),
            ],
            options={
                'ordering': ('-published',),
            },
        ),
    ]
Example #25
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('coverImage',
                 models.ImageField(blank=True,
                                   upload_to=blog.models.get_image_path)),
                ('summary', models.TextField(blank=True, max_length=255)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('is_published', models.BooleanField(default=False)),
                ('date_published', models.DateTimeField(blank=True,
                                                        null=True)),
            ],
            options={
                'ordering':
                ['-is_published', '-date_published', '-date_created'],
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=120)),
                ('slug', models.SlugField(unique=True)),
                ('image',
                 models.ImageField(blank=True,
                                   height_field='height_field',
                                   null=True,
                                   upload_to=blog.models.upload_location,
                                   width_field='width_field')),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('content', models.TextField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['-timestamp', 'updated'],
            },
        ),
    ]
Example #27
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='PostModel',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('active', models.BooleanField(default=True)),
                ('title', models.CharField(error_messages={'required': 'Please enter your title', 'unique': 'This title is not unique, please try again.'}, help_text='Must be a unique title.', max_length=240, unique=True, verbose_name='Post title')),
                ('slug', models.SlugField(blank=True, null=True)),
                ('content', models.TextField(blank=True, null=True)),
                ('publish', models.CharField(choices=[('draft', 'Draft'), ('publish', 'Publish'), ('private', 'Private')], default='draft', max_length=120)),
                ('view_count', models.IntegerField(default=0)),
                ('publish_date', models.DateField(default=django.utils.timezone.now)),
                ('author_email', models.EmailField(blank=True, max_length=240, null=True, validators=[blog.models.validate_Email])),
                ('updated', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Post',
                'verbose_name_plural': 'Posts',
            },
        ),
    ]
Example #28
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='blogpost',
            name='body',
            field=models.TextField(blank=True, max_length=5000),
        ),
        migrations.AlterField(
            model_name='blogpost',
            name='image',
            field=models.ImageField(blank=True, upload_to=blog.models.upload_location),
        ),
        migrations.AlterField(
            model_name='blogpost',
            name='title',
            field=models.CharField(blank=True, max_length=50),
        ),
        migrations.CreateModel(
            name='ActivityPost',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=50)),
                ('start_time', models.DateTimeField()),
                ('end_time', models.DateTimeField()),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Example #29
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BlogPost',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('body', models.TextField(max_length=5000)),
                ('image',
                 models.ImageField(upload_to=blog.models.upload_location)),
                ('date_published',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date published')),
                ('date_updated',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='date updated')),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0002_auto_20190925_1601'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='post',
            options={'ordering': ['-date_pub']},
        ),
        migrations.AlterModelOptions(
            name='tag',
            options={'ordering': ['title']},
        ),
        migrations.AlterField(
            model_name='post',
            name='slug',
            field=models.SlugField(blank=True, max_length=150, unique=True),
        ),
        migrations.CreateModel(
            name='Images',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=blog.models.get_image_filename, verbose_name='Image')),
                ('post', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='blog.Post')),
            ],
        ),
    ]