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

    dependencies = [
        ('blogs', '0007_post_featured_media'),
    ]

    operations = [
        migrations.AddField(
            model_name='post',
            name='is_featured_video',
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(
            model_name='post',
            name='featured_media',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=blogs.models.Post.get_upload_path,
                validators=[
                    utils.validators.ContentTypeValidator(accepted_types=[
                        'image/jpeg', 'image/png', 'image/gif', 'video/mpeg',
                        'video/quicktime', 'video/mp4'
                    ]),
                    utils.validators.MaxFileSizeValidator(max_size=1048576)
                ]),
        ),
    ]
Ejemplo n.º 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'],
            },
        ),
    ]
Ejemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        ('blogs', '0008_auto_20171229_0950'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='category',
            options={'ordering': ['name'], 'verbose_name': 'category', 'verbose_name_plural': 'categories'},
        ),
        migrations.AlterField(
            model_name='category',
            name='name',
            field=models.CharField(max_length=30, verbose_name='nombre'),
        ),
        migrations.AlterField(
            model_name='post',
            name='author',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='author'),
        ),
        migrations.AlterField(
            model_name='post',
            name='body',
            field=models.TextField(verbose_name='body'),
        ),
        migrations.AlterField(
            model_name='post',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='post',
            name='featured_media',
            field=models.FileField(blank=True, null=True, upload_to=blogs.models.Post.get_upload_path, validators=[utils.validators.ContentTypeValidator(accepted_types=['image/jpeg', 'image/png', 'image/gif', 'video/mpeg', 'video/quicktime', 'video/mp4']), utils.validators.MaxFileSizeValidator(max_size=1048576)], verbose_name='featured media'),
        ),
        migrations.AlterField(
            model_name='post',
            name='is_featured_video',
            field=models.BooleanField(default=False, verbose_name='is featured video?'),
        ),
        migrations.AlterField(
            model_name='post',
            name='pub_date',
            field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='publication date'),
        ),
        migrations.AlterField(
            model_name='post',
            name='summary',
            field=models.TextField(verbose_name='summary'),
        ),
        migrations.AlterField(
            model_name='post',
            name='title',
            field=models.CharField(max_length=100, verbose_name='title'),
        ),
    ]
Ejemplo n.º 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')),
            ],
        ),
    ]
Ejemplo n.º 5
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')),
                ('title', models.CharField(max_length=100)),
                ('slug', models.SlugField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('message', models.TextField(blank=True)),
                ('name', models.CharField(blank=True, max_length=50)),
                ('email', models.CharField(blank=True, max_length=50)),
                ('subject', models.CharField(blank=True, max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('publish', models.BooleanField(default=True)),
                ('title', models.CharField(blank=True, max_length=50)),
                ('description', models.CharField(blank=True, max_length=200)),
                ('link', models.URLField(blank=True, default='')),
                ('image_url', models.URLField(blank=True, default='')),
                ('content', models.TextField(blank=True)),
                ('tags', models.CharField(blank=True, max_length=50)),
                ('author',
                 models.ForeignKey(
                     default=blogs.models.get_anonymous_user,
                     null=True,
                     on_delete=django.db.models.deletion.SET_DEFAULT,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('creationDate',
                 models.DateField(default=datetime.date.today,
                                  verbose_name='Date')),
                ('publish', models.BooleanField(default=True)),
                ('title', models.CharField(blank=True, max_length=50)),
                ('tagline', models.CharField(blank=True, max_length=100)),
                ('background',
                 models.ImageField(default='blog_background/default.jpg',
                                   upload_to='blog_background/')),
                ('content', models.TextField(blank=True)),
                ('tags', models.CharField(blank=True, max_length=50)),
                ('author',
                 models.ForeignKey(
                     default=blogs.models.get_anonymous_user,
                     null=True,
                     on_delete=django.db.models.deletion.SET_DEFAULT,
                     to=settings.AUTH_USER_MODEL)),
                ('category',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='blogs.Category')),
            ],
            options={
                'ordering': ['creationDate'],
            },
        ),
    ]
Ejemplo n.º 6
0
class Migration(migrations.Migration):

    dependencies = [
        ('blogs', '0009_auto_20180114_1915'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='category',
            options={
                'ordering': ['name'],
                'verbose_name': 'categoría',
                'verbose_name_plural': 'categorías'
            },
        ),
        migrations.AlterModelOptions(
            name='post',
            options={
                'get_latest_by': '-pub_date',
                'ordering': ['-pub_date'],
                'verbose_name': 'artículo'
            },
        ),
        migrations.AlterField(
            model_name='post',
            name='author',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='autor'),
        ),
        migrations.AlterField(
            model_name='post',
            name='body',
            field=models.TextField(verbose_name='cuerpo'),
        ),
        migrations.AlterField(
            model_name='post',
            name='featured_media',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=blogs.models.Post.get_upload_path,
                validators=[
                    utils.validators.ContentTypeValidator(accepted_types=[
                        'image/jpeg', 'image/png', 'image/gif', 'video/mpeg',
                        'video/quicktime', 'video/mp4'
                    ]),
                    utils.validators.MaxFileSizeValidator(max_size=1048576)
                ],
                verbose_name='imagen o vídeo destacado'),
        ),
        migrations.AlterField(
            model_name='post',
            name='is_featured_video',
            field=models.BooleanField(default=False,
                                      verbose_name='¿es un vídeo destacado?'),
        ),
        migrations.AlterField(
            model_name='post',
            name='pub_date',
            field=models.DateTimeField(default=django.utils.timezone.now,
                                       verbose_name='fecha de publicación'),
        ),
        migrations.AlterField(
            model_name='post',
            name='summary',
            field=models.TextField(verbose_name='introducción'),
        ),
        migrations.AlterField(
            model_name='post',
            name='title',
            field=models.CharField(max_length=100, verbose_name='título'),
        ),
    ]
Ejemplo n.º 7
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'),
        ),
    ]
Ejemplo n.º 8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='TestUpload',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('video_upload',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=blogs.models.upload_video)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=2000)),
                ('content', ckeditor_uploader.fields.RichTextUploadingField()),
                ('date_posted', models.DateTimeField(blank=True, null=True)),
                ('approved',
                 models.CharField(choices=[('Y', 'Approved'),
                                           ('N', 'Pending')],
                                  default='N',
                                  max_length=1)),
                ('blog_image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=blogs.models.upload_image_path)),
                ('slug',
                 models.SlugField(blank=True, max_length=2000, null=True)),
                ('category',
                 models.CharField(choices=[('P', 'Python'), ('D', 'Django'),
                                           ('S', 'SQL'), ('Or', 'Oracle'),
                                           ('JS', 'Javascript'),
                                           ('O', 'Other')],
                                  default='P',
                                  max_length=100)),
                ('video_upload',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=blogs.models.upload_video)),
                ('video_poster',
                 models.ImageField(
                     blank=True,
                     default='default.jpg',
                     null=True,
                     upload_to=blogs.models.upload_video_poster)),
                ('size', models.BigIntegerField(default=0)),
                ('file_type',
                 models.CharField(blank=True, max_length=120, null=True)),
                ('uploaded', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
                ('path', models.TextField(blank=True, null=True)),
                ('video_file_name',
                 models.CharField(blank=True, max_length=120, null=True)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            bases=(meta.models.ModelMeta, models.Model),
        ),
        migrations.CreateModel(
            name='FileTest',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file_test', models.CharField(max_length=200)),
                ('user',
                 models.ForeignKey(default=1,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='FileItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=120,
                                          null=True)),
                ('path', models.TextField(blank=True, null=True)),
                ('size', models.BigIntegerField(default=0)),
                ('file_type',
                 models.CharField(blank=True, max_length=120, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('uploaded', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
                ('user',
                 models.ForeignKey(default=1,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Favorite',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('add_favorite', models.BooleanField(default=False)),
                ('post',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='blogs.Post')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]