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

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='GameImage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(blank=True, upload_to='game_images/')),
            ],
        ),
        migrations.CreateModel(
            name='Level',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=50, null=True, verbose_name='Название')),
                ('timer', models.IntegerField(default=0, verbose_name='Таймер в минутах')),
                ('rating', models.IntegerField(default=0, verbose_name='+рейтинг')),
                ('balance', models.IntegerField(default=0, verbose_name='+баланс в %')),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('image', models.ImageField(upload_to=api.models.game_images_dir)),
                ('code', models.CharField(default=uuid.uuid4, max_length=36)),
                ('lev', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='api.level')),
            ],
        ),
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('game_type', models.IntegerField(blank=True, null=True)),
                ('image', models.ImageField(blank=True, upload_to='games/')),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('start', models.DateTimeField(auto_now_add=True)),
                ('result', models.BooleanField(default=False)),
                ('level', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='api.level')),
                ('player', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 2
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AddField(
            model_name='room',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True,
                                       default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='room',
            name='code',
            field=models.CharField(default=api.models.generate_unique_code,
                                   max_length=8,
                                   unique=True),
        ),
        migrations.AlterField(
            model_name='room',
            name='id',
            field=models.BigAutoField(auto_created=True,
                                      primary_key=True,
                                      serialize=False,
                                      verbose_name='ID'),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('image',
                 models.ImageField(upload_to=api.models.image_dir_path)),
                ('summary', models.TextField(max_length=1000)),
                ('slug',
                 models.SlugField(blank=True, editable=False, max_length=200)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
        ),
    ]
Ejemplo n.º 4
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('api', '0043_order_status'),
    ]

    operations = [
        migrations.CreateModel(
            name='ResetToken',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('token',
                 models.CharField(default=api.models.randomResetToken,
                                  max_length=200)),
                ('date_added', models.DateTimeField(auto_now_add=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Room',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('code',
                 models.CharField(default=api.models.generate_unique_code,
                                  max_length=8,
                                  unique=True)),
                ('host', models.CharField(max_length=50, unique=True)),
                ('guest_can_pause', models.BooleanField(default=False)),
                ('votes_to_skip', models.IntegerField(default=1)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('current_song', models.CharField(max_length=50)),
            ],
        ),
    ]
Ejemplo n.º 6
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Players',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('userType', models.CharField(default='GUEST', max_length=8)),
                ('username',
                 models.CharField(default=api.models.generate_nickname,
                                  max_length=16)),
                ('host',
                 models.CharField(default='', max_length=50, unique=True)),
                ('password', models.CharField(default='password',
                                              max_length=16)),
            ],
        ),
    ]
Ejemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(max_length=255, unique=True)),
                ('username', models.CharField(max_length=50, unique=True)),
                ('password', models.CharField(max_length=50)),
                ('date_joined', models.DateField()),
                ('last_login', models.DateTimeField()),
                ('rapid_rating', models.IntegerField(default=600)),
                ('blitz_rating', models.IntegerField(default=600)),
                ('bullet_rating', models.IntegerField(default=600)),
                ('is_active', models.BooleanField(default=True)),
                ('staff', models.BooleanField(default=False)),
                ('admin', models.BooleanField(default=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,
            },
        ),
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fen', models.TextField()),
                ('black', models.ForeignKey(on_delete=models.SET(api.models.get_deleted_user), related_name='black_games', to=settings.AUTH_USER_MODEL)),
                ('white', models.ForeignKey(on_delete=models.SET(api.models.get_deleted_user), related_name='white_games', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Texts',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('vocabulary', models.IntegerField(default=1)),
                ('text',
                 models.CharField(default='Тут має бути текст',
                                  max_length=999)),
            ],
        ),
        migrations.CreateModel(
            name='Typer',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('code',
                 models.CharField(default=api.models.generate_unique_code,
                                  max_length=8,
                                  unique=True)),
                ('nick', models.CharField(default='', max_length=16)),
                ('host',
                 models.CharField(default='', max_length=50, unique=True)),
                ('guest_can_pause', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('text',
                 models.CharField(default=api.models.getText, max_length=999)),
            ],
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='room',
            name='code',
            field=models.CharField(default=api.models.generate_unique_code, max_length=8, unique=True),
        ),
        migrations.AlterField(
            model_name='room',
            name='id',
            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),
    ]
Ejemplo n.º 10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Res',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
                ('file', models.FileField(upload_to='files/2021-05-04/')),
                ('code', models.CharField(default=api.models.unique_code, max_length=10)),
            ],
        ),
    ]
Ejemplo n.º 11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Room',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(default=api.models.generate_random_code, max_length=8, unique=True)),
                ('host_name', models.CharField(max_length=50)),
                ('current_players', models.IntegerField(default=0)),
                ('max_players', models.IntegerField(default=4)),
                ('is_public', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
    ]
Ejemplo n.º 12
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Casamento',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to=api.models.casamento_path)),
                ('approved', models.BooleanField(blank=True, default=False)),
            ],
        ),
    ]
Ejemplo n.º 13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Brand',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('detail',
                 models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='DriveType',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('detail', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Engine',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('detail', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='FuelType',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('detail', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Origin',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('detail',
                 models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Segment',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('detail', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='VTypeEngine',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=200,
                                  null=True,
                                  unique=True)),
                ('detail', models.TextField(blank=True, null=True)),
                ('VType',
                 models.ForeignKey(
                     blank=True,
                     limit_choices_to=api.models.VTypeEngine.choice,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='api.engine')),
            ],
        ),
        migrations.CreateModel(
            name='Car',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('carName', models.CharField(max_length=200, unique=True)),
                ('yearEdition',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('hoursePower',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('torque',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('highLight',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('detail', models.TextField()),
                ('brand',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='api.brand')),
                ('driveType',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='api.drivetype')),
                ('fuelType',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='api.fueltype')),
                ('origin',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='api.origin')),
                ('segment',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='api.segment')),
            ],
        ),
    ]
Ejemplo n.º 14
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.BigAutoField(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')),
                ('username',
                 models.CharField(max_length=150,
                                  unique=True,
                                  validators=[
                                      django.contrib.auth.validators.
                                      UnicodeUsernameValidator()
                                  ])),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=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={
                'abstract': False,
            },
            managers=[
                ('objects', api.models.UserManager()),
            ],
        ),
    ]
Ejemplo n.º 15
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('item', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('task', models.CharField(max_length=100)),
                ('description', models.CharField(max_length=300)),
                ('criteria', models.CharField(max_length=100)),
                ('status',
                 models.CharField(choices=[('1', 'Not started'),
                                           ('2', 'On going'), ('3', 'Done')],
                                  default='1',
                                  max_length=40)),
                ('estimate',
                 models.IntegerField(
                     validators=[django.core.validators.MinValueValidator(0)])
                 ),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.category')),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='owner',
                                   to=settings.AUTH_USER_MODEL)),
                ('responsible',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='responsible',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('img',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=api.models.upload_avatar_path)),
                ('user_profile',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='user_profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 16
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Athlete',
            fields=[
                ('id', models.BigAutoField(auto_created=True,
                 primary_key=True, serialize=False, verbose_name='ID')),
                ('card_id', models.IntegerField()),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='ControlPoint',
            fields=[
                ('id', models.BigAutoField(auto_created=True,
                 primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('desc', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.BigAutoField(auto_created=True,
                 primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Record',
            fields=[
                ('id', models.BigAutoField(auto_created=True,
                 primary_key=True, serialize=False, verbose_name='ID')),
                ('results', models.JSONField(default=list)),
                ('athlete', models.ForeignKey(
                    on_delete=django.db.models.deletion.CASCADE, to='api.athlete')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True,
                 primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('control_points', models.JSONField(default=list,
                 validators=[api.models.validate_control_points])),
                ('event', models.ForeignKey(
                    on_delete=django.db.models.deletion.CASCADE, to='api.event')),
            ],
        ),
        migrations.AddField(
            model_name='athlete',
            name='category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='api.category'),
        ),
    ]