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=blogs.models.upload_location,
                                   width_field='width_field')),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('content', models.TextField()),
                ('updated', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
        ),
    ]
示例#2
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=200)),
                ('slug', models.SlugField(unique=True)),
                ('content', models.TextField()),
                ('image',
                 models.ImageField(
                     blank=True,
                     height_field='height_field',
                     null=True,
                     upload_to=blogs.models.upload_image_location,
                     width_field='width_field')),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('likes', models.BooleanField()),
                ('hits', models.IntegerField(default=0)),
                ('draft', models.BooleanField(default=False)),
                ('publish', models.DateField()),
                ('update', models.DateTimeField(auto_now_add=True)),
                ('created', models.DateTimeField(auto_now=True)),
                ('user',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created', '-update'],
            },
        ),
    ]
示例#3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name', models.CharField(max_length=15)),
                ('last_name', models.CharField(max_length=15)),
                ('email', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=120)),
                ('content', models.TextField(blank=True, null=True)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('viewedCount', models.IntegerField(default=0,
                                                    editable=False)),
                ('coverimg',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=blogs.models.upload_location)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('readtime', models.TimeField(blank=True, null=True)),
                ('author',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-updated', '-created'],
            },
        ),
    ]
示例#4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('blog_id', models.IntegerField()),
                ('title', models.CharField(max_length=255)),
                ('overview', models.CharField(max_length=255)),
                ('category', models.CharField(max_length=90)),
                ('content', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('thumbnail',
                 models.ImageField(upload_to=blogs.models.author_blog_images)),
                ('documents',
                 models.FileField(
                     upload_to=blogs.models.author_document_path)),
                ('featured', models.BooleanField()),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('next_post',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='next',
                     to='blogs.Blog')),
                ('previous_post',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='previous',
                     to='blogs.Blog')),
            ],
        ),
    ]
示例#5
0
class Migration(migrations.Migration):

    dependencies = [
        ('products', '0008_orders_order_n'),
        ('blogs', '0005_auto_20191001_1332'),
    ]

    operations = [
        migrations.AddField(
            model_name='blogs',
            name='page_description',
            field=models.CharField(blank=True, max_length=500, null=True),
        ),
        migrations.AddField(
            model_name='blogs',
            name='page_title',
            field=models.CharField(blank=True, max_length=500, null=True),
        ),
        migrations.CreateModel(
            name='OldBlogs',
            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, max_length=255, unique=True)),
                ('short_desc', models.TextField(blank=True, null=True)),
                ('text', models.TextField()),
                ('image', models.ImageField(blank=True, null=True, upload_to=blogs.models.upload_image_path)),
                ('publish', models.DateField(auto_now=True)),
                ('number_views', models.IntegerField(default=0)),
                ('page_title', models.CharField(blank=True, max_length=500, null=True)),
                ('page_description', models.CharField(blank=True, max_length=500, null=True)),
                ('category', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='products.Categories')),
            ],
            options={
                'verbose_name': 'Старая Статья',
                'verbose_name_plural': 'Старые Статьи',
            },
        ),
    ]
示例#6
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('published', models.BooleanField(default=False)),
                ('published_on',
                 models.DateTimeField(blank=True, default=None, null=True)),
                ('updated',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('title', models.CharField(max_length=150)),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('description', models.CharField(max_length=500)),
                ('thumbnail',
                 imageit.models.ScaleItImageField(
                     blank=True,
                     max_height=250,
                     max_width=250,
                     null=True,
                     quality=100,
                     upload_to=blogs.models.Blog.get_upload_path,
                     upscale=False)),
                ('banner',
                 imageit.models.ScaleItImageField(
                     blank=True,
                     null=True,
                     upload_to=blogs.models.Blog.get_upload_path)),
                ('views', models.IntegerField(default=0)),
                ('content', djrichtextfield.models.RichTextField(default='')),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-published_on', 'title'],
            },
        ),
        migrations.CreateModel(
            name='Series',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('slug', models.SlugField(max_length=150)),
            ],
        ),
        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='SeriesAssignment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('entry_no', models.IntegerField()),
                ('blog',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='blogs.blog')),
                ('series',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='blogs.series')),
            ],
        ),
        migrations.CreateModel(
            name='BlogImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 imageit.models.ScaleItImageField(
                     upload_to=blogs.models.BlogImage.get_upload_path)),
                ('blog',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='blogs.blog')),
            ],
        ),
        migrations.AddField(
            model_name='blog',
            name='tags',
            field=models.ManyToManyField(to='blogs.Tag'),
        ),
    ]