Пример #1
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=apps.blog.models.upload_localtion)),
                ('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_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #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')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('vote_score', models.FloatField(db_index=True, default=0)),
                ('num_vote_up',
                 models.PositiveIntegerField(db_index=True, default=0)),
                ('num_vote_down',
                 models.PositiveIntegerField(db_index=True, default=0)),
                ('slug', models.SlugField(unique=True)),
                ('publish_date', models.DateTimeField(blank=True, null=True)),
                ('title', models.CharField(max_length=200)),
                ('image',
                 models.ImageField(blank=True,
                                   height_field='height_field',
                                   null=True,
                                   upload_to=apps.blog.models.upload_location,
                                   width_field='width_field')),
                ('width_field', models.IntegerField(default=0)),
                ('height_field', models.IntegerField(default=0)),
                ('image_caption',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('draft', models.BooleanField(default=False)),
                ('body', models.TextField()),
                ('keywords', models.TextField(blank=True, null=True)),
                ('author',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering':
                ['-vote_score', '-num_vote_up', '-publish_date', '-modified'],
            },
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='autor',
            name='estado',
            field=models.BooleanField(default=True,
                                      verbose_name='Estado Activo/Inactivo'),
        ),
        migrations.AlterField(
            model_name='categoria',
            name='estado',
            field=models.BooleanField(default=True,
                                      verbose_name='Estado Activo/Inactivo'),
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('titulo', models.CharField(max_length=90, verbose_name=True)),
                ('slug', models.SlugField(unique=True, verbose_name='Slug')),
                ('descripcion',
                 models.CharField(max_length=110, verbose_name='descripción')),
                ('imagen',
                 models.ImageField(upload_to=apps.blog.models.custom_upload_to,
                                   verbose_name='Imagen')),
                ('estado',
                 models.BooleanField(default=True,
                                     verbose_name='Estado Activo/Inactivo')),
                ('fecha_creacion',
                 models.DateField(auto_now_add=True,
                                  verbose_name='Fecha de Creacíon')),
                ('autor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Autor')),
                ('categoria',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Categoria')),
            ],
            options={
                'verbose_name': 'Post',
                'verbose_name_plural': 'Posts',
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0003_post_contenido'),
    ]

    operations = [
        migrations.AddField(
            model_name='autor',
            name='imagen',
            field=models.ImageField(
                blank=True,
                null=True,
                upload_to=apps.blog.models.custom_autor_upload_to,
                verbose_name='Imagen'),
        ),
        migrations.AlterField(
            model_name='post',
            name='imagen',
            field=models.ImageField(
                upload_to=apps.blog.models.custom_autor_upload_to,
                verbose_name='Imagen'),
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='post',
            name='foto_encabezado',
            field=models.ImageField(
                blank=True,
                null=True,
                upload_to=apps.blog.models.update_filename),
        ),
    ]
Пример #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')),
                ('file',
                 models.FileField(blank=True,
                                  max_length=500,
                                  upload_to=apps.blog.models.create_file_path,
                                  verbose_name='Attachment')),
                ('title', models.CharField(max_length=128,
                                           verbose_name='title')),
                ('image',
                 models.ImageField(
                     default='images/no_img_available.jpg',
                     max_length=500,
                     upload_to=apps.blog.models.create_image_path,
                     verbose_name='post image')),
                ('content', models.TextField(verbose_name='post content')),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'blog',
                'verbose_name_plural': "blog's",
                'db_table': 'blog',
            },
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='post',
            name='imagen',
            field=models.ImageField(
                blank=True,
                null=True,
                upload_to=apps.blog.models.custom_post_upload_to,
                verbose_name='Imagen'),
        ),
        migrations.AlterField(
            model_name='post',
            name='titulo',
            field=models.CharField(max_length=90, verbose_name='Titulo'),
        ),
    ]
Пример #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')),
                ('descripcion', models.CharField(max_length=200)),
                ('foto_encabezado',
                 models.ImageField(
                     null=True, upload_to=apps.blog.models.update_filename)),
                ('titulo', models.CharField(max_length=200)),
                ('contenido', markdownx.models.MarkdownxField()),
                ('fecha_creado',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('fecha_publicado', models.DateTimeField(blank=True,
                                                         null=True)),
                ('tags',
                 tagging.fields.TagField(blank=True, max_length=255,
                                         null=True)),
                ('autor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]