Example #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('core', '0003_itemmodel'),
    ]

    operations = [
        migrations.AlterField(
            model_name='itemmodel',
            name='data_product_lid',
            field=models.PositiveIntegerField(
                blank=True,
                default='1605723706',
                null=True,
                verbose_name='id для генерации в шаблоне'),
        ),
        migrations.AlterField(
            model_name='itemmodel',
            name='image',
            field=models.ImageField(
                height_field='image_height',
                upload_to=apps.core.models.image_upload_path,
                verbose_name='Основное фото',
                width_field='image_width'),
        ),
        migrations.AlterField(
            model_name='itemmodel',
            name='image_mouseover',
            field=models.ImageField(
                height_field='image_height',
                upload_to=apps.core.models.image_upload_path,
                verbose_name='Фото при наведении мыши',
                width_field='image_width'),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=250)),
                ('address',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('phone_number', models.CharField(max_length=13)),
                ('created_by',
                 models.ForeignKey(blank=True,
                                   db_column='created_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_customer_created_by',
                                   to=settings.AUTH_USER_MODEL)),
                ('updated_by',
                 models.ForeignKey(blank=True,
                                   db_column='updated_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_customer_updated_by',
                                   to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.PROTECT,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', apps.core.models.AuditBaseManager()),
            ],
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=250)),
                ('gender',
                 models.CharField(choices=[('M', 'MALE'), ('F', 'FEMALE')],
                                  default='M',
                                  max_length=1)),
                ('created_by',
                 models.ForeignKey(blank=True,
                                   db_column='created_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_employee_created_by',
                                   to=settings.AUTH_USER_MODEL)),
                ('updated_by',
                 models.ForeignKey(blank=True,
                                   db_column='updated_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_employee_updated_by',
                                   to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.PROTECT,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', apps.core.models.AuditBaseManager()),
            ],
        ),
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('beverage_name', models.CharField(max_length=150)),
                ('beverage_type',
                 models.CharField(choices=[('C', 'COFFEE'), ('T', 'TEA')],
                                  default='C',
                                  max_length=1)),
                ('caffeinated', models.BooleanField(default=False)),
                ('flavored', models.BooleanField(default=False)),
                ('on_hand', models.PositiveIntegerField(default=0)),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     default=Decimal('0.00'),
                                     max_digits=5)),
                ('warn_limit', models.PositiveIntegerField(default=3)),
                ('created_by',
                 models.ForeignKey(blank=True,
                                   db_column='created_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_inventory_created_by',
                                   to=settings.AUTH_USER_MODEL)),
                ('updated_by',
                 models.ForeignKey(blank=True,
                                   db_column='updated_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_inventory_updated_by',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', apps.core.models.AuditBaseManager()),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('state',
                 models.CharField(choices=[('A', 'APPROVED'),
                                           ('C', 'CANCELED'), ('N', 'CREATED'),
                                           ('P', 'PENDING'),
                                           ('R', 'REJECTED')],
                                  default='N',
                                  max_length=1)),
                ('review_date', models.DateTimeField(blank=True, null=True)),
                ('comments', models.TextField(blank=True, null=True)),
                ('created_by',
                 models.ForeignKey(blank=True,
                                   db_column='created_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_order_created_by',
                                   to=settings.AUTH_USER_MODEL)),
                ('customer',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='shop.Customer')),
                ('handler',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   to='shop.Employee')),
                ('updated_by',
                 models.ForeignKey(blank=True,
                                   db_column='updated_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_order_updated_by',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', apps.core.models.AuditBaseManager()),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('quantity', models.PositiveIntegerField(default=1)),
                ('unit_price',
                 models.DecimalField(decimal_places=2,
                                     default=Decimal('0.00'),
                                     max_digits=5)),
                ('created_by',
                 models.ForeignKey(blank=True,
                                   db_column='created_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_orderitem_created_by',
                                   to=settings.AUTH_USER_MODEL)),
                ('item',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='shop.Inventory')),
                ('order',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='shop.Order')),
                ('updated_by',
                 models.ForeignKey(blank=True,
                                   db_column='updated_by',
                                   editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='shop_orderitem_updated_by',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', apps.core.models.AuditBaseManager()),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Challenge',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('name',
                 models.CharField(max_length=30,
                                  unique=True,
                                  verbose_name='Name')),
                ('description', models.TextField(verbose_name='Description')),
                ('value',
                 models.PositiveIntegerField(default=1000,
                                             null=True,
                                             verbose_name='Value')),
                ('category',
                 models.CharField(max_length=100,
                                  null=True,
                                  verbose_name='Category')),
                ('state',
                 models.CharField(choices=[('visible', 'visible'),
                                           ('hidden', 'hidden'),
                                           ('locked', 'locked')],
                                  default='visible',
                                  max_length=100,
                                  verbose_name='State')),
                ('max_attempts',
                 models.PositiveIntegerField(default=0,
                                             verbose_name='Max attempts')),
            ],
            options={
                'verbose_name': 'Challenge',
            },
        ),
        migrations.CreateModel(
            name='Dict',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name': 'BaseModel',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('submission', models.TextField(verbose_name='Submission')),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge',
                                   verbose_name='Challenge')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
            options={
                'verbose_name': 'Submission',
            },
        ),
        migrations.CreateModel(
            name='DynamicChallenge',
            fields=[
                ('challenge_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ctf.challenge')),
                ('minimum',
                 models.PositiveIntegerField(default=100,
                                             null=True,
                                             verbose_name='Minimim value')),
                ('decay',
                 models.PositiveIntegerField(default=25,
                                             null=True,
                                             verbose_name='Decay')),
            ],
            options={
                'verbose_name': 'DynamicChallenge',
            },
            bases=('ctf.challenge', ),
        ),
        migrations.CreateModel(
            name='Solve',
            fields=[
                ('submission_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ctf.submission')),
            ],
            options={
                'verbose_name': 'Solve',
            },
            bases=('ctf.submission', ),
        ),
        migrations.CreateModel(
            name='StandardChallenge',
            fields=[
                ('challenge_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ctf.challenge')),
            ],
            options={
                'verbose_name': 'StandardChallenge',
            },
            bases=('ctf.challenge', ),
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('content', models.CharField(max_length=80)),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge')),
            ],
            options={
                'verbose_name': 'Tag',
            },
        ),
        migrations.CreateModel(
            name='Hint',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('content',
                 models.CharField(max_length=100, verbose_name='Зөвлөгөө')),
                ('state',
                 models.CharField(choices=[('visible', 'visible'),
                                           ('hidden', 'hidden'),
                                           ('locked', 'locked')],
                                  default='visible',
                                  max_length=100,
                                  verbose_name='State')),
                ('cost',
                 models.PositiveIntegerField(default=0,
                                             verbose_name='Татвар')),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge',
                                   verbose_name='Challenge')),
            ],
            options={
                'verbose_name': 'Hint',
            },
        ),
        migrations.CreateModel(
            name='Flag',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('content', models.TextField()),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge')),
            ],
            options={
                'verbose_name': 'Flag',
            },
        ),
        migrations.CreateModel(
            name='Config',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('key', models.CharField(db_index=True, max_length=200)),
                ('value', models.CharField(db_index=True, max_length=200)),
                ('container',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.dict')),
            ],
            options={
                'verbose_name': 'BaseModel',
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='challenge',
            name='flags',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='challenge_flag',
                to='ctf.flag',
                verbose_name='Flag'),
        ),
        migrations.AddField(
            model_name='challenge',
            name='hints',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='challenge_hint',
                to='ctf.hint'),
        ),
        migrations.AddField(
            model_name='challenge',
            name='tags',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='challenge_tag',
                to='ctf.tag'),
        ),
    ]
Example #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Competition',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('name',
                 models.CharField(default='OyuSec',
                                  max_length=100,
                                  verbose_name='Name')),
                ('description',
                 models.TextField(default='CTF', verbose_name='Description')),
                ('status',
                 models.CharField(choices=[('coming', 'coming'),
                                           ('archive', 'archive'),
                                           ('live', 'live')],
                                  default='coming',
                                  max_length=100,
                                  verbose_name='Status')),
                ('slug', models.SlugField(unique=True)),
                ('photo',
                 models.URLField(
                     blank=True,
                     default=
                     'https://github.com/OyuTech/Utils/blob/main/oyusec/oyusec.png',
                     null=True)),
                ('rule', models.TextField(default='')),
                ('prize', models.TextField()),
                ('location',
                 models.CharField(default='онлайн',
                                  max_length=100,
                                  verbose_name='Location')),
                ('enrollment',
                 models.CharField(choices=[('solo', 'solo'), ('team', 'team')],
                                  default='solo',
                                  max_length=100,
                                  verbose_name='Enrollment')),
                ('start_date', models.DateTimeField(blank=True)),
                ('end_date', models.DateTimeField(blank=True)),
                ('weight',
                 models.FloatField(default=20.0, verbose_name='Weight')),
            ],
            options={
                'verbose_name': 'Competition',
            },
        ),
        migrations.CreateModel(
            name='CompetitionUser',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('score',
                 models.PositiveIntegerField(default=0.0,
                                             verbose_name='Score')),
                ('rating', models.FloatField(default=0.0,
                                             verbose_name='Rating')),
                ('place',
                 models.PositiveIntegerField(default=0, verbose_name='Place')),
                ('competition',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='competition.competition')),
            ],
            options={
                'verbose_name': 'Competition User',
            },
        ),
    ]
Example #5
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='News',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='Is active')),
                ('title',
                 models.CharField(max_length=255,
                                  null=True,
                                  verbose_name='Title')),
                ('slug',
                 autoslug.fields.AutoSlugField(editable=False,
                                               populate_from='title',
                                               unique_with=('title', ),
                                               verbose_name='Slug')),
                ('preview',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Preview')),
                ('full_text',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Full text')),
                ('image',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=apps.core.models.BaseModel.file_upload_path,
                     verbose_name='Image')),
                ('views',
                 models.PositiveIntegerField(default=0, verbose_name='Views')),
                ('author',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='news_author',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='Author')),
                ('tracks',
                 models.ManyToManyField(blank=True,
                                        related_name='news',
                                        to='music.Track',
                                        verbose_name='Tracks')),
            ],
            options={
                'verbose_name': 'News',
                'verbose_name_plural': 'News',
            },
        ),
    ]
Example #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='File',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('name',
                 models.CharField(max_length=255,
                                  null=True,
                                  verbose_name='Name')),
                ('file',
                 models.FileField(
                     null=True,
                     upload_to=apps.core.models.BaseModel.file_upload_path,
                     verbose_name='File')),
                ('category',
                 models.CharField(blank=True,
                                  choices=[('music', 'Music'),
                                           ('gtp', 'Guitar PRO'),
                                           ('text', 'Text'),
                                           ('video', 'Video')],
                                  default='music',
                                  max_length=255,
                                  null=True,
                                  verbose_name='Category')),
            ],
            options={
                'verbose_name': 'File',
                'verbose_name_plural': 'Files',
            },
        ),
        migrations.CreateModel(
            name='Track',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='Is active')),
                ('name',
                 models.CharField(max_length=255,
                                  null=True,
                                  verbose_name='Name')),
                ('year',
                 models.IntegerField(blank=True,
                                     null=True,
                                     verbose_name='Year')),
                ('slug',
                 autoslug.fields.AutoSlugField(editable=False,
                                               populate_from='name',
                                               unique_with=('name', ),
                                               verbose_name='Slug')),
                ('image',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=apps.core.models.BaseModel.file_upload_path,
                     verbose_name='Image')),
                ('description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Description')),
                ('file',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='tracks',
                                   to='music.File',
                                   verbose_name='File')),
            ],
            options={
                'verbose_name': 'Track',
                'verbose_name_plural': 'Tracks',
                'ordering': ('-created', ),
            },
        ),
        migrations.CreateModel(
            name='TrackFile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.PositiveIntegerField(default=0,
                                             verbose_name='Sort order')),
                ('file',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='related_tracks',
                                   to='music.File',
                                   verbose_name='File')),
                ('track',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='extra_files',
                                   to='music.Track',
                                   verbose_name='Track')),
            ],
            options={
                'verbose_name': 'Track File',
                'verbose_name_plural': 'Track Files',
                'ordering': ('sort_order', ),
            },
        ),
    ]
Example #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('competition', '0002_auto_20210330_1646'),
    ]

    operations = [
        migrations.CreateModel(
            name='Challenge',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('name',
                 models.CharField(max_length=30,
                                  unique=True,
                                  verbose_name='Name')),
                ('description', models.TextField(verbose_name='Description')),
                ('value',
                 models.PositiveIntegerField(default=1000,
                                             null=True,
                                             verbose_name='Value')),
                ('category',
                 models.CharField(max_length=100,
                                  null=True,
                                  verbose_name='Category')),
                ('state',
                 models.CharField(choices=[('visible', 'visible'),
                                           ('hidden', 'hidden'),
                                           ('locked', 'locked')],
                                  default='visible',
                                  max_length=100,
                                  verbose_name='State')),
                ('max_attempts',
                 models.PositiveIntegerField(default=0,
                                             verbose_name='Max attempts')),
                ('solution',
                 models.CharField(default='',
                                  max_length=500,
                                  null=True,
                                  verbose_name='Solution')),
                ('competition',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='competition.competition')),
                ('user',
                 models.ForeignKey(default=apps.ctf.models.get_admin,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Author')),
            ],
            options={
                'verbose_name': 'Challenge',
            },
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('submission', models.TextField(verbose_name='Submission')),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge',
                                   verbose_name='Challenge')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
            options={
                'verbose_name': 'Submission',
            },
        ),
        migrations.CreateModel(
            name='Writeup',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('content', models.TextField(verbose_name='Content')),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='author',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Author')),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge',
                                   verbose_name='Challenge')),
            ],
            options={
                'verbose_name': 'Writeup',
            },
        ),
        migrations.CreateModel(
            name='DynamicChallenge',
            fields=[
                ('challenge_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ctf.challenge')),
                ('initial',
                 models.PositiveIntegerField(default=1000,
                                             null=True,
                                             verbose_name='Initial value')),
                ('minimum',
                 models.PositiveIntegerField(default=100,
                                             null=True,
                                             verbose_name='Minimum value')),
                ('decay',
                 models.PositiveIntegerField(default=25,
                                             null=True,
                                             verbose_name='Decay')),
            ],
            options={
                'verbose_name': 'Dynamic challenge',
            },
            bases=('ctf.challenge', ),
        ),
        migrations.CreateModel(
            name='Solve',
            fields=[
                ('submission_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ctf.submission')),
            ],
            options={
                'verbose_name': 'Solve',
            },
            bases=('ctf.submission', ),
        ),
        migrations.CreateModel(
            name='StandardChallenge',
            fields=[
                ('challenge_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ctf.challenge')),
            ],
            options={
                'verbose_name': 'Standard challenge',
            },
            bases=('ctf.challenge', ),
        ),
        migrations.CreateModel(
            name='WriteupUser',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('reaction',
                 models.CharField(choices=[('like', 'like'),
                                           ('dislike', 'dislike')],
                                  default='like',
                                  max_length=100,
                                  verbose_name='Reaction')),
                ('author',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='writeup_user',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Writeup User')),
                ('writeup',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.writeup',
                                   verbose_name='Writeup')),
            ],
            options={
                'verbose_name': 'Writeup User',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('content', models.CharField(max_length=80)),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge')),
            ],
            options={
                'verbose_name': 'Tag',
            },
        ),
        migrations.CreateModel(
            name='Hint',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('content',
                 models.CharField(max_length=100, verbose_name='Зөвлөгөө')),
                ('state',
                 models.CharField(choices=[('visible', 'visible'),
                                           ('hidden', 'hidden'),
                                           ('locked', 'locked')],
                                  default='visible',
                                  max_length=100,
                                  verbose_name='State')),
                ('cost',
                 models.PositiveIntegerField(default=0, verbose_name='Cost')),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge',
                                   verbose_name='Challenge')),
            ],
            options={
                'verbose_name': 'Hint',
            },
        ),
        migrations.CreateModel(
            name='Flag',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('content',
                 models.CharField(max_length=100, verbose_name='Content')),
                ('challenge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge')),
            ],
            options={
                'verbose_name': 'Flag',
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='AssignedProductAttribute',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='AssignedVariantAttribute',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Attribute',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('private_metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('slug', models.SlugField(max_length=250, unique=True)),
                ('name', models.CharField(max_length=255)),
                ('input_type',
                 models.CharField(choices=[('dropdown', 'Dropdown'),
                                           ('multiselect', 'Multi Select')],
                                  default='dropdown',
                                  max_length=50)),
                ('value_required',
                 models.BooleanField(blank=True, default=False)),
                ('is_variant_only',
                 models.BooleanField(blank=True, default=False)),
                ('visible_in_storefront',
                 models.BooleanField(blank=True, default=True)),
                ('filterable_in_storefront',
                 models.BooleanField(blank=True, default=True)),
                ('filterable_in_dashboard',
                 models.BooleanField(blank=True, default=True)),
                ('storefront_search_position',
                 models.IntegerField(blank=True, default=0)),
                ('available_in_grid',
                 models.BooleanField(blank=True, default=True)),
            ],
            options={
                'ordering': ('storefront_search_position', 'slug'),
            },
        ),
        migrations.CreateModel(
            name='AttributeValue',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(db_index=True, editable=False,
                                     null=True)),
                ('name', models.CharField(max_length=250)),
                ('value',
                 models.CharField(blank=True, default='', max_length=100)),
                ('slug', models.SlugField(max_length=255)),
                ('attribute',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='values',
                                   to='product.attribute')),
            ],
            options={
                'ordering': ('sort_order', 'id'),
                'unique_together': {('slug', 'attribute')},
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('private_metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('name', models.CharField(max_length=250)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('description', models.TextField(blank=True)),
                ('description_json', models.JSONField(blank=True,
                                                      default=dict)),
                ('background_image',
                 versatileimagefield.fields.VersatileImageField(
                     blank=True, null=True, upload_to='category-backgrounds')),
                ('background_image_alt',
                 models.CharField(blank=True, max_length=128)),
                ('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',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='children',
                                   to='product.category')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Collection',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('publication_date', models.DateField(blank=True, null=True)),
                ('is_published', models.BooleanField(default=False)),
                ('private_metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('name', models.CharField(max_length=250, unique=True)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('background_image',
                 versatileimagefield.fields.VersatileImageField(
                     blank=True, null=True,
                     upload_to='collection-backgrounds')),
                ('background_image_alt',
                 models.CharField(blank=True, max_length=128)),
                ('description', models.TextField(blank=True)),
                ('description_json', models.JSONField(blank=True,
                                                      default=dict)),
            ],
            options={
                'ordering': ('slug', ),
            },
        ),
        migrations.CreateModel(
            name='DigitalContent',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('private_metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('use_default_settings', models.BooleanField(default=True)),
                ('automatic_fulfillment', models.BooleanField(default=False)),
                ('content_type',
                 models.CharField(choices=[('file', 'digital_product')],
                                  default='file',
                                  max_length=128)),
                ('content_file',
                 models.FileField(blank=True, upload_to='digital_contents')),
                ('max_downloads', models.IntegerField(blank=True, null=True)),
                ('url_valid_days', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('publication_date', models.DateField(blank=True, null=True)),
                ('is_published', models.BooleanField(default=False)),
                ('private_metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('name', models.CharField(max_length=250)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('description', models.TextField(blank=True)),
                ('description_json',
                 apps.core.models.SanitizedJSONField(
                     blank=True,
                     default=dict,
                     sanitizer=draftjs_sanitizer.clean_draft_js)),
                ('price_amount',
                 models.DecimalField(decimal_places=2, max_digits=12)),
                ('minimal_variant_price_amount',
                 models.DecimalField(decimal_places=2, max_digits=12)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
                ('charge_taxes', models.BooleanField(default=True)),
                ('category',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='products',
                     to='product.category')),
            ],
            options={
                'ordering': ('name', ),
                'permissions': (('manage_products', 'Manage products.'), ),
            },
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(db_index=True, editable=False,
                                     null=True)),
                ('image',
                 versatileimagefield.fields.VersatileImageField(
                     upload_to='products')),
                ('ppoi',
                 versatileimagefield.fields.PPOIField(default='0.5x0.5',
                                                      editable=False,
                                                      max_length=20)),
                ('alt', models.CharField(blank=True, max_length=128)),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='images',
                                   to='product.product')),
            ],
            options={
                'ordering': ('sort_order', ),
            },
        ),
        migrations.CreateModel(
            name='ProductType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('private_metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('name', models.CharField(max_length=250)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('has_variants', models.BooleanField(default=True)),
                ('is_shipping_required', models.BooleanField(default=True)),
                ('is_digital', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ('slug', ),
            },
        ),
        migrations.CreateModel(
            name='ProductVariant',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('private_metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('metadata',
                 models.JSONField(
                     blank=True,
                     default=dict,
                     encoder=apps.core.utils.json_serializer.CustomJsonEncoder,
                     null=True)),
                ('sku', models.CharField(max_length=255, unique=True)),
                ('name', models.CharField(blank=True, max_length=255)),
                ('price_override_amount',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=12,
                                     null=True)),
                ('track_inventory', models.BooleanField(default=True)),
                ('cost_price_amount',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=12,
                                     null=True)),
            ],
            options={
                'ordering': ('sku', ),
            },
        ),
        migrations.CreateModel(
            name='VariantImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='variant_images',
                                   to='product.productimage')),
                ('variant',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='variant_images',
                                   to='product.productvariant')),
            ],
        ),
        migrations.AddField(
            model_name='productvariant',
            name='images',
            field=models.ManyToManyField(through='product.VariantImage',
                                         to='product.ProductImage'),
        ),
        migrations.AddField(
            model_name='productvariant',
            name='product',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='variants',
                to='product.product'),
        ),
        migrations.AddField(
            model_name='product',
            name='product_type',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='products',
                to='product.producttype'),
        ),
        migrations.CreateModel(
            name='DigitalContentUrl',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('token', models.UUIDField(editable=False, unique=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('download_num', models.IntegerField(default=0)),
                ('content',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='urls',
                                   to='product.digitalcontent')),
                ('line',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='digital_content_url',
                     to='order.orderline')),
            ],
        ),
        migrations.AddField(
            model_name='digitalcontent',
            name='product_variant',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='digital_content',
                to='product.productvariant'),
        ),
        migrations.CreateModel(
            name='CollectionProduct',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(db_index=True, editable=False,
                                     null=True)),
                ('collection',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='collectionproduct',
                                   to='product.collection')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='collectionproduct',
                                   to='product.product')),
            ],
            options={
                'unique_together': {('collection', 'product')},
            },
        ),
        migrations.AddField(
            model_name='collection',
            name='products',
            field=models.ManyToManyField(blank=True,
                                         related_name='collections',
                                         through='product.CollectionProduct',
                                         to='product.Product'),
        ),
        migrations.CreateModel(
            name='AttributeVariant',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(db_index=True, editable=False,
                                     null=True)),
                ('assigned_variants',
                 models.ManyToManyField(
                     blank=True,
                     related_name='attributesrelated',
                     through='product.AssignedVariantAttribute',
                     to='product.ProductVariant')),
                ('attribute',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='attributevariant',
                                   to='product.attribute')),
                ('product_type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='attributevariant',
                                   to='product.producttype')),
            ],
            options={
                'ordering': ('sort_order', ),
                'unique_together': {('attribute', 'product_type')},
            },
        ),
        migrations.CreateModel(
            name='AttributeProduct',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(db_index=True, editable=False,
                                     null=True)),
                ('assigned_products',
                 models.ManyToManyField(
                     blank=True,
                     related_name='attributesrelated',
                     through='product.AssignedProductAttribute',
                     to='product.Product')),
                ('attribute',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='attributeproduct',
                                   to='product.attribute')),
                ('product_type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='attributeproduct',
                                   to='product.producttype')),
            ],
            options={
                'ordering': ('sort_order', ),
                'unique_together': {('attribute', 'product_type')},
            },
        ),
        migrations.AddField(
            model_name='attribute',
            name='product_types',
            field=models.ManyToManyField(blank=True,
                                         related_name='product_attributes',
                                         through='product.AttributeProduct',
                                         to='product.ProductType'),
        ),
        migrations.AddField(
            model_name='attribute',
            name='product_variant_types',
            field=models.ManyToManyField(blank=True,
                                         related_name='variant_attributes',
                                         through='product.AttributeVariant',
                                         to='product.ProductType'),
        ),
        migrations.AddField(
            model_name='assignedvariantattribute',
            name='assignment',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='variantassignments',
                to='product.attributevariant'),
        ),
        migrations.AddField(
            model_name='assignedvariantattribute',
            name='values',
            field=models.ManyToManyField(to='product.AttributeValue'),
        ),
        migrations.AddField(
            model_name='assignedvariantattribute',
            name='variant',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='attributes',
                to='product.productvariant'),
        ),
        migrations.AddField(
            model_name='assignedproductattribute',
            name='assignment',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='productassignments',
                to='product.attributeproduct'),
        ),
        migrations.AddField(
            model_name='assignedproductattribute',
            name='product',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='attributes',
                to='product.product'),
        ),
        migrations.AddField(
            model_name='assignedproductattribute',
            name='values',
            field=models.ManyToManyField(to='product.AttributeValue'),
        ),
        migrations.CreateModel(
            name='AttributeValueTranslation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('language_code', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=100)),
                ('attribute_value',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='translations',
                                   to='product.attributevalue')),
            ],
            options={
                'unique_together': {('language_code', 'attribute_value')},
            },
        ),
        migrations.CreateModel(
            name='AttributeTranslation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('language_code', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=100)),
                ('attribute',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='translations',
                                   to='product.attribute')),
            ],
            options={
                'unique_together': {('language_code', 'attribute')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='assignedvariantattribute',
            unique_together={('variant', 'assignment')},
        ),
        migrations.AlterUniqueTogether(
            name='assignedproductattribute',
            unique_together={('product', 'assignment')},
        ),
    ]
Example #9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('data', '0001_initial'),
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Pixeler',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Analysis',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('secondary_data', models.FileField(upload_to=apps.core.models.Analysis.secondary_data_upload_to, verbose_name='Secondary data')),
                ('notebook', models.FileField(blank=True, help_text='Upload your Jupiter Notebook or any other document helping to understand your analysis', upload_to=apps.core.models.Analysis.notebook_upload_to, verbose_name='Notebook')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('saved_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Analysis',
                'verbose_name_plural': 'Analyses',
            },
        ),
        migrations.CreateModel(
            name='Experiment',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('released_at', models.DateField(verbose_name='Release date')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('saved_at', models.DateTimeField(auto_now=True)),
                ('entries', models.ManyToManyField(related_name='experiments', related_query_name='experiment', to='data.Entry')),
            ],
            options={
                'verbose_name': 'Experiment',
                'verbose_name_plural': 'Experiments',
            },
        ),
        migrations.CreateModel(
            name='OmicsArea',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='Name')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(db_index=True, editable=False)),
                ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='core.OmicsArea')),
            ],
            options={
                'verbose_name': 'Omics area',
                'verbose_name_plural': 'Omics areas',
            },
        ),
        migrations.CreateModel(
            name='OmicsUnit',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('status', models.PositiveSmallIntegerField(choices=[(1, 'Dubious'), (2, 'Exists'), (3, 'Invalid'), (4, 'Validated')], default=1, verbose_name='Status')),
                ('reference', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='data.Entry')),
            ],
            options={
                'verbose_name': 'Omics Unit',
                'verbose_name_plural': 'Omics Units',
            },
        ),
        migrations.CreateModel(
            name='OmicsUnitType',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='Name')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
            ],
            options={
                'verbose_name': 'Omics unit type',
                'verbose_name_plural': 'Omics unit types',
            },
        ),
        migrations.CreateModel(
            name='Pixel',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('value', models.FloatField(help_text='The pixel value', verbose_name='Value')),
                ('quality_score', models.FloatField(blank=True, help_text='Could be a p-value, confidence index, etc.', null=True, verbose_name='Quality score')),
                ('analysis', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pixels', related_query_name='pixel', to='core.Analysis')),
                ('omics_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pixels', related_query_name='pixel', to='core.OmicsUnit')),
            ],
            options={
                'verbose_name': 'Pixel',
                'verbose_name_plural': 'Pixels',
            },
        ),
        migrations.CreateModel(
            name='Species',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='Name')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('reference', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='species', related_query_name='species', to='data.Entry')),
            ],
            options={
                'verbose_name': 'Species',
                'verbose_name_plural': 'Species',
            },
        ),
        migrations.CreateModel(
            name='Strain',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='Name')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('species', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='strains', related_query_name='strain', to='core.Species')),
            ],
            options={
                'verbose_name': 'Strain',
                'verbose_name_plural': 'Strains',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField()),
                ('count', models.IntegerField(default=0, help_text='Internal counter of how many times this tag is in use')),
                ('protected', models.BooleanField(default=False, help_text='Will not be deleted when the count reaches 0')),
            ],
            options={
                'ordering': ('name',),
                'abstract': False,
            },
            bases=(tagulous.models.models.BaseTagModel, models.Model),
        ),
        migrations.AlterUniqueTogether(
            name='tag',
            unique_together=set([('slug',)]),
        ),
        migrations.AddField(
            model_name='omicsunit',
            name='strain',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='omics_units', related_query_name='omics_unit', to='core.Strain'),
        ),
        migrations.AddField(
            model_name='omicsunit',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='omics_units', related_query_name='omics_unit', to='core.OmicsUnitType'),
        ),
        migrations.AddField(
            model_name='experiment',
            name='omics_area',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='experiments', related_query_name='experiment', to='core.OmicsArea'),
        ),
        migrations.AddField(
            model_name='experiment',
            name='tags',
            field=tagulous.models.fields.TagField(_set_tag_meta=True, help_text='Enter a comma-separated tag string', to='core.Tag'),
        ),
        migrations.AddField(
            model_name='analysis',
            name='experiments',
            field=models.ManyToManyField(related_name='analyses', related_query_name='analysis', to='core.Experiment'),
        ),
        migrations.AddField(
            model_name='analysis',
            name='pixeler',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='analyses', related_query_name='analysis', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='analysis',
            name='tags',
            field=tagulous.models.fields.TagField(_set_tag_meta=True, help_text='Enter a comma-separated tag string', to='core.Tag'),
        ),
        migrations.AlterUniqueTogether(
            name='strain',
            unique_together=set([('name', 'species')]),
        ),
        migrations.AlterUniqueTogether(
            name='omicsunit',
            unique_together=set([('reference', 'strain', 'type')]),
        ),
    ]
Example #10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Affectation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('is_removed', models.BooleanField(default=False)),
                ('comment', models.TextField(blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('is_removed', models.BooleanField(default=False)),
                ('date', models.DateField()),
                ('duration_hours', models.IntegerField(blank=True, null=True)),
                ('duration_minutes', models.IntegerField(blank=True,
                                                         null=True)),
            ],
            options={
                'verbose_name_plural': 'Events',
                'verbose_name': 'Event',
            },
        ),
        migrations.CreateModel(
            name='Feature',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('menu_item_name',
                 models.CharField(max_length=100, verbose_name='Item Name')),
                ('url', models.CharField(max_length=100, verbose_name='Url')),
                ('icon', models.CharField(max_length=100,
                                          verbose_name='Icon')),
                ('position',
                 models.PositiveIntegerField(blank=True,
                                             null=True,
                                             verbose_name='Position')),
                ('child',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='child_feature',
                     to='core.Feature')),
                ('permission', models.ManyToManyField(to='auth.Permission')),
            ],
            options={
                'verbose_name_plural': 'Features',
                'verbose_name': 'Feature',
            },
        ),
        migrations.CreateModel(
            name='Holiday',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('is_removed', models.BooleanField(default=False)),
                ('day', models.DateField()),
            ],
            options={
                'verbose_name_plural': 'Holidays',
                'verbose_name': 'Holiday',
            },
        ),
        migrations.CreateModel(
            name='Hour',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('is_removed', models.BooleanField(default=False)),
                ('start_time', models.TimeField()),
                ('end_time', models.TimeField(blank=True, null=True)),
            ],
            options={
                'verbose_name_plural': 'Hours',
                'verbose_name': 'Hour',
            },
        ),
        migrations.CreateModel(
            name='MotiveAffectation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
            ],
            options={
                'verbose_name_plural': 'MotiveAffectations',
                'verbose_name': 'MotiveAffectation',
            },
        ),
        migrations.CreateModel(
            name='NonWorkingDay',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('is_removed', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=20)),
                ('number_day', models.IntegerField()),
            ],
            options={
                'verbose_name_plural': 'NonWorkingDays',
                'verbose_name': 'NonWorkingDay',
            },
        ),
        migrations.CreateModel(
            name='Profession',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('is_removed', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=200)),
                ('abbreviation', models.CharField(max_length=10)),
            ],
            options={
                'verbose_name_plural': 'Professions',
                'verbose_name': 'Profession',
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('is_removed', models.BooleanField(default=False)),
                ('phone', models.CharField(blank=True,
                                           max_length=15,
                                           null=True)),
                ('color', models.CharField(blank=True, max_length=7,
                                           null=True)),
                ('admin', models.NullBooleanField()),
                ('avatar',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=apps.core.models.get_path_avatar)),
                ('profession',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='core.Profession')),
                ('user',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Profiles',
                'verbose_name': 'Profile',
            },
        ),
        migrations.CreateModel(
            name='Status',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name_plural': 'Statuses',
                'verbose_name': 'Status',
            },
        ),
        migrations.CreateModel(
            name='Turn',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('is_removed', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=100)),
                ('duration_hours', models.IntegerField(blank=True, null=True)),
                ('duration_minutes', models.IntegerField(blank=True,
                                                         null=True)),
                ('hour',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='core.Hour')),
            ],
            options={
                'ordering': ['hour__start_time'],
                'verbose_name_plural': 'Turns',
                'verbose_name': 'Turn',
            },
        ),
        migrations.AddField(
            model_name='event',
            name='profile',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='core.Profile'),
        ),
        migrations.AddField(
            model_name='event',
            name='status',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='core.Status'),
        ),
        migrations.AddField(
            model_name='event',
            name='turn',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='core.Turn'),
        ),
        migrations.AddField(
            model_name='affectation',
            name='hour',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='core.Hour'),
        ),
        migrations.AddField(
            model_name='affectation',
            name='motive',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='core.MotiveAffectation'),
        ),
    ]
Example #11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Academy',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('name',
                 models.CharField(max_length=100,
                                  unique=True,
                                  verbose_name='Name')),
                ('description',
                 models.TextField(default='CTF', verbose_name='Description')),
                ('status',
                 models.CharField(choices=[('coming', 'coming'),
                                           ('archive', 'archive'),
                                           ('live', 'live')],
                                  default='live',
                                  max_length=100,
                                  verbose_name='Status')),
                ('slug', models.SlugField(unique=True)),
                ('photo',
                 models.URLField(
                     blank=True,
                     default=
                     'https://github.com/OyuTech/Utils/blob/main/oyusec/oyusec.png',
                     null=True)),
                ('category',
                 models.CharField(choices=[
                     ('Capture The Flag', 'Capture The Flag'),
                     ('Сүлжээний аюулгүй байдал', 'Сүлжээний аюулгүй байдал'),
                     ('Веб аюулгүй байдал', 'Веб аюулгүй байдал'),
                     ('Аюулгүй кодчилол', 'Аюулгүй кодчилол')
                 ],
                                  default='Capture The Flag',
                                  max_length=100,
                                  verbose_name='Category')),
            ],
            options={
                'verbose_name': 'Academy',
            },
        ),
        migrations.CreateModel(
            name='AcademyUser',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
            ],
            options={
                'verbose_name': 'Academy User',
            },
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('content',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Content')),
                ('question',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Question')),
                ('answer',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Answer')),
                ('point',
                 models.PositiveIntegerField(default=0, verbose_name='Point')),
                ('hint',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Hint')),
            ],
            options={
                'verbose_name': 'Section',
            },
        ),
        migrations.CreateModel(
            name='SectionUser',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('is_completed', models.BooleanField(default=False)),
                ('section',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='academy.section')),
            ],
            options={
                'verbose_name': 'Section User',
            },
        ),
    ]
Example #12
0
class Migration(migrations.Migration):
    initial = True

    operations = [
        migrations.CreateModel(
            name='DepositTransaction',
            fields=[
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('dash_address',
                 models.CharField(
                     max_length=35,
                     validators=[apps.core.validators.dash_address_validator
                                 ])),
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('dash_to_transfer',
                 models.DecimalField(decimal_places=8, max_digits=16)),
                ('state',
                 models.PositiveSmallIntegerField(choices=[
                     (1,
                      'Initiated. Send {dash_to_transfer} DASH to {dash_address}'
                      ),
                     (2,
                      'Received {dash_to_transfer} DASH. Waiting for {confirmations_number} confirmations'
                      ),
                     (3,
                      'Confirmed receiving {dash_to_transfer} DASH. Initiated an outgoing transaction'
                      ),
                     (4,
                      'Transaction is processed. Hash of a Ripple transaction is {outgoing_ripple_transaction_hash}'
                      ),
                     (5,
                      'Time expired. Transactions to {dash_address} are no longer tracked'
                      ),
                     (6,
                      'Transaction failed. Please contact our support team'),
                     (7,
                      'The ripple account {ripple_address} does not trust our gateway. Please set a trust line to {gateway_ripple_address}'
                      )
                 ],
                                                  default=1)),
                ('ripple_address',
                 models.CharField(
                     max_length=35,
                     validators=[
                         apps.core.validators.ripple_address_validator
                     ])),
                ('outgoing_ripple_transaction_hash',
                 models.CharField(blank=True, max_length=64)),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model, apps.core.models.TransactionStates),
        ),
        migrations.CreateModel(
            name='DepositTransactionStateChange',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('datetime', models.DateTimeField(auto_now_add=True)),
                ('current_state', models.CharField(max_length=500)),
                ('transaction',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='state_changes',
                                   to='core.DepositTransaction')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GatewaySettings',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('gateway_fee_percent',
                 models.DecimalField(
                     decimal_places=2,
                     default=0,
                     max_digits=5,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ],
                     verbose_name='Gateway fee (percentage)')),
                ('max_dash_miner_fee',
                 models.DecimalField(
                     decimal_places=8,
                     default=Decimal('0.1'),
                     help_text=
                     'This value is used to calculate amount that is sent in withdrawal transactions. <b>It should be the same as <code>maxtxfee</code> of your Dash node.</b>',
                     max_digits=16,
                     validators=[django.core.validators.MinValueValidator(0)],
                     verbose_name='Dash - maximal miner fee')),
                ('dash_required_confirmations',
                 models.PositiveIntegerField(
                     default=6, verbose_name='Dash - minimal confirmations')),
                ('transaction_expiration_minutes',
                 models.PositiveIntegerField(
                     default=60,
                     verbose_name='Transaction expiration (minutes)')),
            ],
            options={
                'verbose_name': 'Gateway Settings',
            },
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('slug', models.SlugField(max_length=300, unique=True)),
                ('title', models.CharField(max_length=200,
                                           verbose_name='Title')),
                ('description',
                 models.TextField(blank=True, verbose_name='Description')),
            ],
            options={
                'ordering': ('-title', ),
            },
        ),
        migrations.CreateModel(
            name='RippleWalletCredentials',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('address',
                 models.CharField(
                     max_length=35,
                     validators=[
                         apps.core.validators.ripple_address_validator
                     ],
                     verbose_name='Address')),
                ('secret',
                 encrypted_fields.fields.EncryptedCharField(
                     max_length=29, verbose_name='Secret key')),
            ],
            options={
                'verbose_name': 'Ripple Wallet Credentials',
            },
        ),
        migrations.CreateModel(
            name='WithdrawalTransaction',
            fields=[
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('dash_address',
                 models.CharField(
                     max_length=35,
                     validators=[apps.core.validators.dash_address_validator
                                 ])),
                ('id',
                 models.BigAutoField(primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('dash_to_transfer',
                 models.DecimalField(decimal_places=8,
                                     max_digits=16,
                                     validators=[
                                         apps.core.validators.
                                         withdrawal_min_dash_amount_validator
                                     ])),
                ('state',
                 models.PositiveSmallIntegerField(choices=[
                     (1,
                      'Initiated. Send {dash_to_transfer} Dash tokens to {ripple_address} with a destination tag {destination_tag}'
                      ),
                     (3,
                      'Received {dash_to_transfer} Dash tokens. Initiated an outgoing transaction'
                      ),
                     (4,
                      'Transaction is processed. Hash of a Dash transaction is {outgoing_dash_transaction_hash}'
                      ),
                     (5,
                      'Time expired. Transactions with the destination tag {destination_tag} are no longer tracked'
                      ),
                     (6, 'Transaction failed. Please contact our support team')
                 ],
                                                  default=1)),
                ('outgoing_dash_transaction_hash',
                 models.CharField(blank=True, max_length=64)),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model, apps.core.models.TransactionStates),
        ),
        migrations.CreateModel(
            name='WithdrawalTransactionStateChange',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('datetime', models.DateTimeField(auto_now_add=True)),
                ('current_state', models.CharField(max_length=500)),
                ('transaction',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='state_changes',
                                   to='core.WithdrawalTransaction')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
Example #13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='DicomNode',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Name')),
                ('aet_title',
                 models.CharField(max_length=100, verbose_name='AET Title')),
                ('peer_aet_title',
                 models.CharField(max_length=100,
                                  verbose_name='Peer AET Title')),
                ('peer_host',
                 models.CharField(max_length=100, verbose_name='Peer Host')),
                ('peer_port', models.IntegerField(verbose_name='Peer Port')),
            ],
            options={
                'db_table': 'dicom_nodes',
            },
        ),
        migrations.CreateModel(
            name='Instance',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sop_instance_uid',
                 models.CharField(max_length=80,
                                  unique=True,
                                  verbose_name='SOP Instance UID')),
                ('instance_number',
                 models.IntegerField(verbose_name='Instance Number')),
                ('rows', models.IntegerField(verbose_name='Rows')),
                ('columns', models.IntegerField(verbose_name='Columns')),
                ('color_space',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Color Space')),
                ('photometric_interpretation',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Photometric Interpretation')),
                ('smallest_image_pixel_value',
                 models.PositiveIntegerField(
                     blank=True,
                     null=True,
                     verbose_name='Smallest Image Pixel Value')),
                ('largest_image_pixel_value',
                 models.PositiveIntegerField(
                     blank=True,
                     null=True,
                     verbose_name='Largest Image Pixel Value')),
                ('pixel_aspect_ratio',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Pixel Aspect Ratio')),
                ('pixel_spacing',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Pixel Spacing')),
                ('image',
                 models.FileField(upload_to=apps.core.models.image_file_path)),
            ],
            options={
                'db_table': 'instances',
            },
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('patient_name',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Patient')),
                ('patient_id',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Patient ID')),
                ('patient_sex',
                 models.CharField(blank=True,
                                  max_length=10,
                                  null=True,
                                  verbose_name='Patient Sex')),
                ('patient_age',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Patient Age')),
                ('patient_birthdate',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Patient Birthdate')),
            ],
            options={
                'db_table': 'patients',
            },
        ),
        migrations.CreateModel(
            name='Plugin',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('version',
                 models.CharField(max_length=20, verbose_name='Version')),
                ('author',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Author')),
                ('info',
                 models.CharField(blank=True,
                                  max_length=500,
                                  null=True,
                                  verbose_name='Information')),
                ('docs',
                 models.TextField(blank=True,
                                  max_length=500,
                                  null=True,
                                  verbose_name='Documentation')),
                ('modalities',
                 jsonfield.fields.JSONField(blank=True,
                                            null=True,
                                            verbose_name='Modalities')),
                ('tags',
                 jsonfield.fields.JSONField(blank=True,
                                            null=True,
                                            verbose_name='Tags')),
                ('params',
                 jsonfield.fields.JSONField(blank=True,
                                            null=True,
                                            verbose_name='Parameters')),
                ('result', jsonfield.fields.JSONField(verbose_name='Result')),
                ('plugin',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to=apps.core.models.plugin_file_path)),
            ],
            options={
                'db_table': 'plugins',
            },
        ),
        migrations.CreateModel(
            name='Series',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('series_instance_uid',
                 models.CharField(max_length=80,
                                  unique=True,
                                  verbose_name='Series Instance UID')),
                ('protocol_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  null=True,
                                  verbose_name='Protocol Name')),
                ('modality',
                 models.CharField(max_length=80, verbose_name='Modality')),
                ('series_number',
                 models.CharField(blank=True,
                                  max_length=80,
                                  null=True,
                                  verbose_name='Series Number')),
                ('patient_position',
                 models.CharField(max_length=30,
                                  verbose_name='Patient Position')),
                ('body_part_examined',
                 models.CharField(blank=True,
                                  max_length=50,
                                  null=True,
                                  verbose_name='Body Part Examined')),
            ],
            options={
                'verbose_name': 'Series',
                'verbose_name_plural': 'Series',
                'db_table': 'series',
            },
        ),
        migrations.CreateModel(
            name='Study',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('study_instance_uid',
                 models.CharField(max_length=80,
                                  unique=True,
                                  verbose_name='Study Instance UID')),
                ('study_id',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Study ID')),
                ('study_description',
                 models.CharField(blank=True,
                                  max_length=300,
                                  null=True,
                                  verbose_name='Study Description')),
                ('referring_physician_name',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Referring Physician')),
                ('patient',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='studies',
                                   to='core.Patient')),
            ],
            options={
                'verbose_name_plural': 'Studies',
                'db_table': 'studies',
            },
        ),
        migrations.AddField(
            model_name='series',
            name='study',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='series',
                to='core.Study'),
        ),
        migrations.AddField(
            model_name='instance',
            name='series',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='instances',
                to='core.Series'),
        ),
    ]
Example #14
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Writeup',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('state',
                 models.CharField(choices=[('visible', 'visible'),
                                           ('hidden', 'hidden'),
                                           ('locked', 'locked')],
                                  default='hidden',
                                  max_length=100,
                                  verbose_name='State')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Name')),
                ('thumbnail',
                 models.URLField(
                     blank=True,
                     default=
                     'https://avatars.githubusercontent.com/u/77679907?v=4',
                     null=True)),
                ('views', models.PositiveIntegerField(default=0)),
                ('content', models.TextField(verbose_name='Content')),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='author',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Author')),
                ('challenge',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.challenge',
                                   verbose_name='Challenge')),
            ],
            options={
                'verbose_name': 'Writeup',
            },
        ),
        migrations.CreateModel(
            name='WriteupUserReaction',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('author',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='writeup_user',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Writeup User')),
                ('writeup',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.writeup',
                                   verbose_name='Writeup')),
            ],
            options={
                'verbose_name': 'Writeup User Reaction',
            },
        ),
        migrations.CreateModel(
            name='WriteupCategory',
            fields=[
                ('uuid',
                 apps.core.models.UUIDField(blank=True,
                                            editable=False,
                                            max_length=32,
                                            primary_key=True,
                                            serialize=False,
                                            unique=True)),
                ('created_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('last_updated_date',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Last updated date')),
                ('content', models.CharField(max_length=100)),
                ('writeup',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ctf.writeup',
                                   verbose_name='Writeup')),
            ],
            options={
                'verbose_name': 'WriteupCategory',
            },
        ),
    ]
Example #15
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('email',
                 models.CharField(max_length=30,
                                  unique=True,
                                  verbose_name='Email')),
                ('name', models.CharField(max_length=30, verbose_name='Name')),
                ('surname',
                 models.CharField(max_length=30, verbose_name='Surname')),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff',
                 models.BooleanField(default=False, verbose_name='Admin?')),
                ('date_joined',
                 models.DateTimeField(default=datetime.datetime(
                     2018, 6, 8, 19, 46, 49, 947801, tzinfo=utc))),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'User',
                'verbose_name_plural': 'Users',
                'db_table': 'users',
            },
            managers=[
                ('objects', apps.core.managers.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='DicomNode',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Name')),
                ('peer_url',
                 models.CharField(max_length=255, verbose_name='Peer URL')),
                ('instances_url',
                 models.CharField(default='/instances',
                                  max_length=255,
                                  verbose_name='WADO Instances URL')),
                ('instance_file_url',
                 models.CharField(default='/instances/{id}/file',
                                  max_length=255,
                                  verbose_name='WADO Instance Image URL')),
            ],
            options={
                'db_table': 'dicom_nodes',
            },
        ),
        migrations.CreateModel(
            name='Instance',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sop_instance_uid',
                 models.CharField(max_length=80,
                                  unique=True,
                                  verbose_name='SOP Instance UID')),
                ('instance_number',
                 models.IntegerField(verbose_name='Instance Number')),
                ('rows', models.IntegerField(verbose_name='Rows')),
                ('columns', models.IntegerField(verbose_name='Columns')),
                ('color_space',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Color Space')),
                ('photometric_interpretation',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Photometric Interpretation')),
                ('smallest_image_pixel_value',
                 models.PositiveIntegerField(
                     blank=True,
                     null=True,
                     verbose_name='Smallest Image Pixel Value')),
                ('largest_image_pixel_value',
                 models.PositiveIntegerField(
                     blank=True,
                     null=True,
                     verbose_name='Largest Image Pixel Value')),
                ('pixel_aspect_ratio',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Pixel Aspect Ratio')),
                ('pixel_spacing',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Pixel Spacing')),
                ('image',
                 models.FileField(upload_to=apps.core.models.image_file_path)),
            ],
            options={
                'db_table': 'instances',
            },
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('patient_name',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Patient')),
                ('patient_id',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Patient ID')),
                ('patient_sex',
                 models.CharField(blank=True,
                                  max_length=10,
                                  null=True,
                                  verbose_name='Patient Sex')),
                ('patient_age',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Patient Age')),
                ('patient_birthdate',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Patient Birthdate')),
            ],
            options={
                'db_table': 'patients',
            },
        ),
        migrations.CreateModel(
            name='Plugin',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=100,
                                  unique=True,
                                  verbose_name='Name')),
                ('display_name',
                 models.CharField(default='',
                                  max_length=150,
                                  verbose_name='Display Name')),
                ('version',
                 models.CharField(max_length=20, verbose_name='Version')),
                ('author',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Author')),
                ('info',
                 models.CharField(blank=True,
                                  max_length=500,
                                  null=True,
                                  verbose_name='Information')),
                ('docs',
                 models.TextField(blank=True,
                                  max_length=500,
                                  null=True,
                                  verbose_name='Documentation')),
                ('modalities',
                 jsonfield.fields.JSONField(blank=True,
                                            null=True,
                                            verbose_name='Modalities')),
                ('tags',
                 jsonfield.fields.JSONField(blank=True,
                                            null=True,
                                            verbose_name='Tags')),
                ('params',
                 jsonfield.fields.JSONField(blank=True,
                                            null=True,
                                            verbose_name='Parameters')),
                ('result', jsonfield.fields.JSONField(verbose_name='Result')),
                ('type',
                 models.CharField(default='ANALYZER',
                                  max_length=40,
                                  verbose_name='Type')),
                ('plugin',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to=apps.core.models.plugin_file_path)),
                ('is_installed',
                 models.BooleanField(default=False,
                                     verbose_name='Is installed')),
            ],
            options={
                'db_table': 'plugins',
            },
        ),
        migrations.CreateModel(
            name='ProcessingResult',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('expire_date', models.DateTimeField()),
                ('image',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to=apps.core.models.processed_image_path,
                     verbose_name='Image')),
                ('json', jsonfield.fields.JSONField(verbose_name='JSON')),
                ('session_token', models.CharField(max_length=255)),
            ],
            options={
                'db_table': 'processing_results',
            },
        ),
        migrations.CreateModel(
            name='Series',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('series_instance_uid',
                 models.CharField(max_length=80,
                                  unique=True,
                                  verbose_name='Series Instance UID')),
                ('protocol_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  null=True,
                                  verbose_name='Protocol Name')),
                ('modality',
                 models.CharField(max_length=80, verbose_name='Modality')),
                ('series_number',
                 models.CharField(blank=True,
                                  max_length=80,
                                  null=True,
                                  verbose_name='Series Number')),
                ('patient_position',
                 models.CharField(max_length=30,
                                  verbose_name='Patient Position')),
                ('body_part_examined',
                 models.CharField(blank=True,
                                  max_length=50,
                                  null=True,
                                  verbose_name='Body Part Examined')),
            ],
            options={
                'verbose_name': 'Series',
                'verbose_name_plural': 'Series',
                'db_table': 'series',
            },
        ),
        migrations.CreateModel(
            name='Study',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('study_instance_uid',
                 models.CharField(max_length=80,
                                  unique=True,
                                  verbose_name='Study Instance UID')),
                ('study_id',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Study ID')),
                ('study_date',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Study Date')),
                ('study_description',
                 models.CharField(blank=True,
                                  max_length=300,
                                  null=True,
                                  verbose_name='Study Description')),
                ('referring_physician_name',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Referring Physician')),
                ('patient',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='studies',
                                   to='core.Patient')),
            ],
            options={
                'verbose_name_plural': 'Studies',
                'db_table': 'studies',
            },
        ),
        migrations.AddField(
            model_name='series',
            name='study',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='series',
                to='core.Study'),
        ),
        migrations.AddField(
            model_name='instance',
            name='series',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='instances',
                to='core.Series'),
        ),
    ]