예제 #1
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('is_active', models.BooleanField(default=True)),
                ('video', models.FileField(blank=True, null=True, storage=cloudinary_storage.storage.VideoMediaCloudinaryStorage(), upload_to=articles.models.upload_video_to, validators=[cloudinary_storage.validators.validate_video])),
                ('cover', models.ImageField(blank=True, null=True, storage=cloudinary_storage.storage.MediaCloudinaryStorage(), upload_to=articles.models.upload_image_to)),
                ('title', models.CharField(max_length=255, unique=True)),
                ('description', models.TextField()),
                ('content', martor.models.MartorField()),
                ('keywords', models.CharField(default='プログラミング', max_length=255, verbose_name='記事のキーワード')),
                ('publish_at', models.DateTimeField(blank=True, null=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('related_articles', models.ManyToManyField(blank=True, related_name='_article_related_articles_+', to='articles.Article', verbose_name='related articles')),
                ('tags', models.ManyToManyField(blank=True, to='tags.Tag')),
            ],
            options={
                'ordering': ['-publish_at', '-timestamp', '-updated'],
            },
        ),
    ]
예제 #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('body', models.TextField()),
                ('document',
                 models.FileField(
                     upload_to='documents/',
                     validators=[articles.models.validate_file_extension])),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
예제 #3
0
class Migration(migrations.Migration):

    dependencies = [
        ('articles', '0003_auto_20190427_2121'),
    ]

    operations = [
        migrations.AlterField(
            model_name='article',
            name='document',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to='documents/%Y%m%D/',
                validators=[articles.models.validate_file_extension],
                verbose_name='Файл'),
        ),
    ]
예제 #4
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')),
                ('article_id', models.IntegerField(unique=True)),
                ('title', models.TextField(max_length=200)),
                ('body', models.TextField()),
                ('pub_date',
                 models.DateTimeField(verbose_name='Date Published')),
                ('likes', models.IntegerField(default=0)),
                ('thumbnail',
                 models.FileField(
                     upload_to=articles.models.get_upload_file_name)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('body', models.TextField()),
                ('pub_date',
                 models.DateTimeField(verbose_name='Date Published')),
                ('article',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='articles.Article')),
            ],
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='article',
            name='author',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='Автор'),
        ),
        migrations.AlterField(
            model_name='article',
            name='body',
            field=models.TextField(verbose_name='Текст'),
        ),
        migrations.AlterField(
            model_name='article',
            name='date',
            field=models.DateTimeField(auto_now_add=True,
                                       verbose_name='Дата создания'),
        ),
        migrations.AlterField(
            model_name='article',
            name='document',
            field=models.FileField(
                upload_to='documents/',
                validators=[articles.models.validate_file_extension],
                verbose_name='Файл'),
        ),
        migrations.AlterField(
            model_name='article',
            name='title',
            field=models.CharField(max_length=255, verbose_name='Заголовок'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('articles', '0003_auto_20170121_1426'),
    ]

    operations = [
        migrations.AddField(
            model_name='article',
            name='thumbnail',
            field=models.FileField(
                default=datetime.datetime(2017,
                                          1,
                                          21,
                                          17,
                                          44,
                                          59,
                                          940513,
                                          tzinfo=utc),
                upload_to=articles.models.get_upload_file_name),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='comment',
            name='pub_date',
            field=models.DateTimeField(default=datetime.datetime(2017,
                                                                 1,
                                                                 21,
                                                                 17,
                                                                 44,
                                                                 42,
                                                                 370542,
                                                                 tzinfo=utc),
                                       verbose_name='date published'),
        ),
    ]
예제 #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=255,
                                           verbose_name='title')),
                ('description',
                 models.TextField(blank=True,
                                  help_text='Type a description...',
                                  max_length=512,
                                  verbose_name='description')),
                ('slug', models.SlugField(editable=False, unique=True)),
                ('section',
                 models.PositiveSmallIntegerField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('is_public', models.BooleanField(default=True)),
                ('semester',
                 models.CharField(blank=True,
                                  choices=[('', '---------'), ('FA', 'Fall'),
                                           ('WI', 'Winter'), ('SP', 'Spring'),
                                           ('SU', 'Summer')],
                                  default='FA',
                                  max_length=2,
                                  verbose_name='semester')),
                ('year',
                 models.PositiveSmallIntegerField(
                     blank=True,
                     choices=[('', '---------'), (2019, 2019), (2018, 2018),
                              (2017, 2017), (2016, 2016), (2015, 2015),
                              (2014, 2014), (2013, 2013), (2012, 2012),
                              (2011, 2011), (2010, 2010), (2009, 2009),
                              (2008, 2008), (2007, 2007), (2006, 2006),
                              (2005, 2005), (2004, 2004), (2003, 2003),
                              (2002, 2002), (2001, 2001), (2000, 2000)],
                     default=articles.models.Article.current_year,
                     null=True,
                     verbose_name='year')),
            ],
        ),
        migrations.CreateModel(
            name='ArticleMedia',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('article_media',
                 models.FileField(
                     upload_to=articles.models.ArticleMedia.upload_to,
                     verbose_name='file upload')),
                ('article_type',
                 models.CharField(choices=[('', '---------'),
                                           ('AD', 'Analyzed Data'),
                                           ('PO', 'Poster'),
                                           ('RD', 'Raw Data'),
                                           ('RE', 'Report'), ('OT', 'Other')],
                                  help_text='Select the file type',
                                  max_length=2,
                                  verbose_name='article type')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('article',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='media',
                                   to='articles.Article')),
            ],
        ),
    ]
예제 #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')),
                ('title', models.CharField(max_length=100)),
                ('slug', models.SlugField(max_length=100, unique=True)),
                ('body', models.TextField()),
                ('posted',
                 models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated', models.DateTimeField(auto_now=True,
                                                 db_index=True)),
                ('sources', models.TextField(null=True)),
                ('document',
                 models.FileField(blank=True, null=True, upload_to=b'')),
                ('language',
                 models.CharField(choices=[('FRENCH', 'Fr'), ('ARABE', 'Ar'),
                                           ('ENGLISH', 'En')],
                                  default='ARABE',
                                  max_length=60)),
                ('published', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-posted', '-updated'],
                'verbose_name_plural': 'articles',
            },
        ),
        migrations.CreateModel(
            name='Categorie',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(db_index=True, max_length=100)),
                ('slug', models.SlugField(max_length=100, 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=articles.models.upload_location,
                                   verbose_name='Image')),
                ('post',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='articles.Article')),
            ],
        ),
    ]