コード例 #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('bot', '0005_auto_20191215_1053'),
    ]

    operations = [
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.PositiveIntegerField()),
                ('first_name', models.CharField(blank=True, max_length=450, null=True)),
                ('last_name', models.CharField(blank=True, max_length=450, null=True)),
                ('username', models.CharField(blank=True, max_length=450, null=True)),
                ('balance', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('created_on', models.DateTimeField(default=datetime.datetime.now)),
                ('invited_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bot.Profile')),
            ],
            options={
                'verbose_name': 'Profile',
                'verbose_name_plural': 'Profiles',
            },
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('card', models.CharField(blank=True, max_length=200, null=True)),
                ('type', models.CharField(choices=[('V', 'Вывод'), ('P', 'Пополнение')], max_length=1)),
                ('sum', models.PositiveIntegerField(blank=True, null=True)),
                ('image', models.ImageField(blank=True, upload_to=bot.models.image_folder)),
                ('pub_date', models.DateTimeField(auto_now_add=True)),
                ('broker', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bot.Profile')),
            ],
            options={
                'verbose_name': 'Transaction',
                'verbose_name_plural': 'Transactions',
                'ordering': ['-pub_date'],
            },
        ),
        migrations.CreateModel(
            name='VerifiedTransaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('verified_sum', models.DecimalField(decimal_places=2, max_digits=10)),
                ('pub_date', models.DateTimeField(auto_now_add=True)),
                ('transaction', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bot.Transaction')),
            ],
            options={
                'verbose_name': 'VerifiedTransaction',
                'verbose_name_plural': 'VerifiedTransactions',
                'ordering': ['-pub_date'],
            },
        ),
        migrations.DeleteModel(
            name='Profiles',
        ),
    ]
コード例 #2
0
class Migration(migrations.Migration):

    dependencies = [
        ('bot', '0048_auto_20200619_1229'),
    ]

    operations = [
        migrations.CreateModel(
            name='Bot',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(default='Default Name',
                                          max_length=32)),
                ('token',
                 models.CharField(default='Default Token',
                                  max_length=512,
                                  unique=True)),
                ('administrators', models.TextField(default='{}')),
            ],
        ),
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('serverId',
                 models.BigIntegerField(default=0,
                                        help_text='Discrod server id')),
                ('name',
                 models.CharField(default='Default name',
                                  help_text='Discord server name',
                                  max_length=64)),
                ('configuration',
                 models.TextField(default='{}',
                                  help_text='Server name configuration (json)',
                                  validators=[bot.models.check_json])),
                ('bot',
                 models.ForeignKey(help_text='Select the bot',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='bot.Bot')),
            ],
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    dependencies = [
        ('bot', '0003_telegramlogentry_text_length'),
    ]

    operations = [
        migrations.AddField(
            model_name='telegramprofile',
            name='created',
            field=model_utils.fields.AutoCreatedField(
                default=django.utils.timezone.now,
                editable=False,
                verbose_name='created'),
        ),
        migrations.AddField(
            model_name='telegramprofile',
            name='modified',
            field=model_utils.fields.AutoLastModifiedField(
                default=django.utils.timezone.now,
                editable=False,
                verbose_name='modified'),
        ),
        migrations.AlterField(
            model_name='telegramlogentry',
            name='version',
            field=models.CharField(default=bot.models.current_version,
                                   editable=False,
                                   max_length=64),
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    dependencies = [
        ('bot', '0045_rackets'),
    ]

    operations = [
        migrations.AlterField(
            model_name='guild',
            name='racketChannels',
            field=models.CharField(blank=True, default='["territory"]', help_text='Name of the racket channels. Can be multiple channels. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
        migrations.AlterField(
            model_name='guild',
            name='racketRoles',
            field=models.CharField(blank=True, default='["Territory"]', help_text='Name of the role to mention. It has to be the exact role name: ["Role a"] or empty array [] for no mentions.', max_length=64),
        ),
    ]
コード例 #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Themes',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255, verbose_name='Дисциплина')),
            ],
        ),
        migrations.CreateModel(
            name='Materials',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('text',
                 models.CharField(max_length=255, verbose_name='Описание')),
                ('pub_date',
                 models.DateTimeField(verbose_name='Дата публикации')),
                ('file',
                 models.FileField(
                     upload_to=bot.models.upload_material_file_folder,
                     verbose_name='Материал')),
                ('theme',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='bot.Themes')),
            ],
        ),
    ]
コード例 #6
0
class Migration(migrations.Migration):

    dependencies = [
        ('bot', '0043_auto_20200405_1902'),
    ]

    operations = [
        migrations.AddField(
            model_name='guild',
            name='racketChannels',
            field=models.CharField(blank=True, default='["rackets"]', help_text='Name of the racket channels. Can be multiple channels. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
        migrations.AddField(
            model_name='guild',
            name='racketModule',
            field=models.BooleanField(default=False, help_text='Enable the Racket module'),
        ),
        migrations.AddField(
            model_name='guild',
            name='racketRoles',
            field=models.CharField(blank=True, default='["rackets"]', help_text='Name of the role to mention. Can be multiple channels. It has to be the exact channel name: ["role-a", "my-other-role"]', max_length=64),
        ),
    ]
コード例 #7
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='botcontext',
            name='session',
            field=models.CharField(
                default=bot.models.get_default_value_for_session,
                max_length=50,
                unique=True),
        ),
    ]
コード例 #8
0
class Migration(migrations.Migration):

    dependencies = [
        ('bot', '0039_auto_20200305_1244'),
    ]

    operations = [
        migrations.AlterField(
            model_name='guild',
            name='apiChannels',
            field=models.CharField(blank=True, default='["*"]', help_text='Name of the channels where API commands are allowed. Keep ["*"] for all channels allowed. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
        migrations.AlterField(
            model_name='guild',
            name='chainChannels',
            field=models.CharField(blank=True, default='["chain"]', help_text='Name of the chain channels. Can be multiple channels. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
        migrations.AlterField(
            model_name='guild',
            name='crimesChannels',
            field=models.CharField(blank=True, default='["oc"]', help_text='Name of the channels where OC commands are allowed. Keep ["*"] for all channels allowed. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
        migrations.AlterField(
            model_name='guild',
            name='lootChannels',
            field=models.CharField(blank=True, default='["loot"]', help_text='Name of the loot channels. Can be multiple channels. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
        migrations.AlterField(
            model_name='guild',
            name='reviveChannels',
            field=models.CharField(blank=True, default='["revive"]', help_text='Name of the revive channels. Can be multiple channels. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
        migrations.AlterField(
            model_name='guild',
            name='stockChannels',
            field=models.CharField(blank=True, default='["stocks"]', help_text='Name of the stock alert channels. Can be multiple channels. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
        migrations.AlterField(
            model_name='guild',
            name='verifyChannels',
            field=models.CharField(blank=True, default='["verify-id"]', help_text='Name of the verify channels. Can be multiple channels. It has to be the exact channel name: ["channel-a", "my-other-channel"]', max_length=64, validators=[bot.models.channel_names_reg]),
        ),
    ]
コード例 #9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='SlackUser',
            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')),
                ('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=150,
                                  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')),
                ('slack_user_id',
                 models.CharField(max_length=20, null=True, unique=True)),
                ('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')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', bot.models.SlackUserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ISIC',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('number', models.CharField(max_length=17)),
                ('active', models.BooleanField(default=True)),
                ('usages', models.PositiveIntegerField(default=0)),
                ('priority',
                 models.PositiveIntegerField(
                     choices=[(1, 'low'), (2, 'medium'), (3, 'high')])),
            ],
        ),
        migrations.CreateModel(
            name='ISICUsageLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('isic',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='usage_logs',
                                   to='bot.ISIC')),
                ('requested_by',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='usage_logs',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='slackuser',
            name='isic',
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='holder',
                to='bot.ISIC'),
        ),
        migrations.AddField(
            model_name='slackuser',
            name='user_permissions',
            field=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'),
        ),
    ]