コード例 #1
0
class Content(core.models.Model):
    is_conversation = False

    # FIXME: remove when django bug #28988 is fixed
    poll = models.OneToOneField('polls.WorkaroundPoll',
                                null=True,
                                blank=True,
                                related_name='content',
                                on_delete=models.CASCADE)

    title = models.CharField(max_length=255)
    image = models.ForeignKey('images.Image',
                              blank=True,
                              null=True,
                              on_delete=models.SET_NULL)

    place = models.CharField(blank=True, max_length=255)

    time = models.DateTimeField(blank=True, null=True)
    until_time = models.DateTimeField(blank=True, null=True)
    all_day = models.BooleanField(default=False)

    associations = contenttypes.GenericRelation(
        'associations.Association',
        content_type_field='container_type',
        object_id_field='container_id',
        related_query_name='content')

    contributions = contenttypes.GenericRelation(
        'contributions.Contribution',
        content_type_field='container_type',
        object_id_field='container_id',
        related_query_name='content')

    taggeds = contenttypes.GenericRelation('tags.Tagged',
                                           content_type_field='tagged_type',
                                           object_id_field='tagged_id',
                                           related_query_name='content')

    def __str__(self):
        return self.title

    def get_authors(self):
        return gestalten.Gestalt.objects.filter(
            Q(versions__content=self)
            | Q(contributions__content=self)).distinct()

    def get_version_authors(self):
        return gestalten.Gestalt.objects.filter(
            versions__content=self).distinct()

    def get_associated_gestalten(self):
        return gestalten.Gestalt.objects.filter(associations__content=self)

    def get_associated_groups(self):
        return groups.Group.objects.filter(associations__content=self)

    def get_unique_id(self):
        return 'content.{}'.format(self.id)

    def get_url_for(self, association):
        return django.urls.reverse(
            'content', args=[association.entity.slug, association.slug])

    @property
    def is_event(self):
        return self.time is not None

    @property
    def is_file(self):
        return self.versions.last().file.exists()

    @property
    def is_gallery(self):
        return self.gallery_images.count() > 0

    @property
    def is_poll(self):
        # FIXME: change when django bug #28988 has been fixed
        # return hasattr(self, 'poll')
        return self.poll is not None

    @property
    def subject(self):
        return self.title
コード例 #2
0
ファイル: models.py プロジェクト: transformaps/stadtgestalten
class Gestalt(core.models.Model):
    is_group = False

    about = models.TextField('Selbstauskunft', blank=True)
    avatar = core.models.ImageField(blank=True)
    avatar_64 = ImageSpecField(source='avatar',
                               processors=[Transpose(),
                                           SmartResize(64, 64)],
                               format='PNG')
    avatar_color = models.CharField(max_length=7,
                                    default=colors.get_random_color)
    background = core.models.ImageField('Hintergrundbild', blank=True)
    background_cover = ImageSpecField(
        source='background',
        processors=[Transpose(), SmartResize(1140, 456)],
        format='JPEG')
    public = models.BooleanField(
        'Benutzerseite veröffentlichen',
        default=False,
        help_text=
        'Öffentliche Benutzerseiten sind für alle Besucherinnen sichtbar.')
    score = models.IntegerField(default=0)
    user = models.OneToOneField(settings.AUTH_USER_MODEL,
                                on_delete=models.CASCADE)

    associations = django.contrib.contenttypes.fields.GenericRelation(
        'associations.Association',
        content_type_field='entity_type',
        object_id_field='entity_id',
        related_query_name='gestalt')

    @property
    def name(self):
        return ' '.join(
            filter(None, [self.user.first_name, self.user.last_name]))

    @property
    def slug(self):
        return self.user.username

    @staticmethod
    def get_or_create(email):
        try:
            created = False
            user = auth.get_user_model().objects.get(emailaddress__email=email)
        except auth.get_user_model().DoesNotExist:
            user, created = auth.get_user_model().objects.get_or_create(
                email=email)
        if created:
            allauth_adapter.get_adapter().populate_username(None, user)
            user.set_unusable_password()
            user.save()
        return user.gestalt

    def __str__(self):
        return self.name or self.slug

    def can_login(self):
        return self.user.has_usable_password()

    def get_absolute_url(self):
        if self.public:
            return self.get_profile_url()
        else:
            return self.get_contact_url()

    def get_contact_url(self):
        return urls.reverse('create-gestalt-conversation', args=(self.pk, ))

    def get_profile_url(self):
        return urls.reverse(
            'entity', args=[type(self).objects.get(pk=self.pk).user.username])

    # FIXME: move to template filter
    def get_initials(self):
        import re
        initials = ''
        for w in str(self).split():
            m = re.search('[a-zA-Z0-9]', w)
            initials += m.group(0) if m else ''
        return initials
コード例 #3
0
class DeleteKey(models.Model):
    changelog = models.OneToOneField(ChangeLog)
    key = models.CharField(max_length=200)
コード例 #4
0
ファイル: 0001_initial.py プロジェクト: cheesycod/FatesList
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='ApiEvent',
            fields=[
                ('id', models.UUIDField(primary_key=True, serialize=False)),
                ('bot_id', models.BigIntegerField()),
                ('events', models.TextField()),
            ],
            options={
                'db_table': 'api_event',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='AuthGroup',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=150, unique=True)),
            ],
            options={
                'db_table': 'auth_group',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='AuthGroupPermissions',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
            options={
                'db_table': 'auth_group_permissions',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='AuthPermission',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('codename', models.CharField(max_length=100)),
            ],
            options={
                'db_table': 'auth_permission',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='AuthUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password', models.CharField(max_length=128)),
                ('last_login', models.DateTimeField(blank=True, null=True)),
                ('is_superuser', models.BooleanField()),
                ('username', models.CharField(max_length=150, unique=True)),
                ('first_name', models.CharField(max_length=150)),
                ('last_name', models.CharField(max_length=150)),
                ('email', models.CharField(max_length=254)),
                ('is_staff', models.BooleanField()),
                ('is_active', models.BooleanField()),
                ('date_joined', models.DateTimeField()),
            ],
            options={
                'db_table': 'auth_user',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='AuthUserGroups',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
            options={
                'db_table': 'auth_user_groups',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='AuthUserUserPermissions',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
            options={
                'db_table': 'auth_user_user_permissions',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='Bot',
            fields=[
                ('bot_id',
                 models.BigIntegerField(primary_key=True, serialize=False)),
                ('prefix', models.CharField(max_length=9)),
                ('owner',
                 models.BigIntegerField(
                     help_text=
                     'Do not change a owner/perform a ownership transfer without permission from both the old and new owner'
                 )),
                ('votes',
                 models.BigIntegerField(
                     blank=True,
                     help_text=
                     'Changing this for no reason may/will lead to punishment such as getting kicked off the staff team or demoted or temporary forced LOA (Leave of absence)',
                     null=True)),
                ('servers', models.BigIntegerField(blank=True, null=True)),
                ('shard_count', models.BigIntegerField(blank=True, null=True)),
                ('bot_library', models.CharField(max_length=32)),
                ('webhook',
                 models.CharField(blank=True, max_length=1024, null=True)),
                ('webhook_type',
                 models.CharField(choices=[('VOTE', 'Vote'),
                                           ('DISCORD', 'Discord Integration'),
                                           ('FC', 'Fates Client')],
                                  max_length=10)),
                ('description', models.CharField(max_length=105)),
                ('api_token',
                 models.CharField(default=uuid.uuid4,
                                  max_length=255,
                                  unique=True)),
                ('website',
                 models.CharField(blank=True, max_length=1024, null=True)),
                ('discord',
                 models.CharField(blank=True, max_length=32, null=True)),
                ('tags',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(), size=None)),
                ('certified', models.BooleanField()),
                ('queue',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Use fateslist.xyz main admin console to verify bots')),
                ('banner',
                 models.CharField(blank=True, max_length=1024, null=True)),
                ('created_at', models.BigIntegerField(blank=True, null=True)),
                ('invite',
                 models.CharField(blank=True, max_length=256, null=True)),
                ('banned',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Use fateslist.xyz main admin console to ban or unban bots'
                 )),
                ('disabled',
                 models.BooleanField(blank=True, help_text='unused',
                                     null=True)),
                ('github',
                 models.CharField(blank=True, max_length=256, null=True)),
                ('extra_owners',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.BigIntegerField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('features',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('private', models.BooleanField(blank=True, null=True)),
                ('html_long_description',
                 models.BooleanField(blank=True, null=True)),
                ('invite_amount', models.IntegerField(blank=True, null=True)),
                ('user_count', models.BigIntegerField(blank=True, null=True)),
                ('css', models.TextField(blank=True, null=True)),
                ('shards',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.IntegerField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('donate',
                 models.CharField(blank=True, max_length=256, null=True)),
                ('username_cached',
                 models.CharField(blank=True, editable=False, max_length=32)),
                ('long_description', models.TextField()),
            ],
            options={
                'db_table': 'bots',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='BotCommands',
            fields=[
                ('id', models.UUIDField(primary_key=True, serialize=False)),
                ('slash', models.IntegerField(blank=True, null=True)),
                ('name', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('args', models.TextField(blank=True, null=True)),
                ('examples', models.TextField(blank=True, null=True)),
                ('premium_only', models.BooleanField(blank=True, null=True)),
                ('notes', models.TextField(blank=True, null=True)),
                ('doc_link', models.TextField(blank=True, null=True)),
                ('bot_id', models.BigIntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'bot_commands',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='BotMaint',
            fields=[
                ('id', models.UUIDField(primary_key=True, serialize=False)),
                ('bot_id', models.BigIntegerField(blank=True, null=True)),
                ('reason', models.TextField(blank=True, null=True)),
                ('type', models.IntegerField(blank=True, null=True)),
                ('epoch', models.BigIntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'bot_maint',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='BotPacks',
            fields=[
                ('id', models.UUIDField(primary_key=True, serialize=False)),
                ('icon', models.TextField(blank=True, null=True)),
                ('banner', models.TextField(blank=True, null=True)),
                ('created_at', models.BigIntegerField(blank=True, null=True)),
                ('owner', models.BigIntegerField(blank=True, null=True)),
                ('api_token',
                 models.TextField(blank=True, null=True, unique=True)),
                ('bots', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('name', models.TextField(blank=True, null=True, unique=True)),
            ],
            options={
                'db_table': 'bot_packs',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='BotPromotions',
            fields=[
                ('id', models.UUIDField(primary_key=True, serialize=False)),
                ('bot_id', models.BigIntegerField(blank=True, null=True)),
                ('title', models.TextField(blank=True, null=True)),
                ('info', models.TextField(blank=True, null=True)),
                ('css', models.TextField(blank=True, null=True)),
                ('type', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'bot_promotions',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='BotReviews',
            fields=[
                ('id', models.UUIDField(primary_key=True, serialize=False)),
                ('bot_id', models.BigIntegerField()),
                ('user_id', models.BigIntegerField()),
                ('star_rating', models.FloatField(blank=True, null=True)),
                ('review_text', models.TextField(blank=True, null=True)),
                ('flagged', models.BooleanField(blank=True, null=True)),
                ('replies', models.TextField(blank=True, null=True)),
                ('epoch', models.TextField(blank=True, null=True)),
                ('review_upvotes', models.TextField(blank=True, null=True)),
                ('review_downvotes', models.TextField(blank=True, null=True)),
                ('reply', models.BooleanField(blank=True, null=True)),
            ],
            options={
                'db_table': 'bot_reviews',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='BotStatsVotes',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bot_id', models.BigIntegerField(blank=True, null=True)),
                ('total_votes', models.BigIntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'bot_stats_votes',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='BotStatsVotesPm',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bot_id', models.BigIntegerField(blank=True, null=True)),
                ('votes', models.BigIntegerField(blank=True, null=True)),
                ('epoch', models.BigIntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'bot_stats_votes_pm',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='BotVoter',
            fields=[
                ('id',
                 models.IntegerField(blank=True,
                                     primary_key=True,
                                     serialize=False)),
                ('bot_id', models.BigIntegerField(blank=True)),
                ('user_id', models.BigIntegerField(blank=True)),
                ('timestamps',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.BigIntegerField(),
                     blank=True,
                     null=True,
                     size=None)),
            ],
            options={
                'db_table': 'bot_voters',
                'ordering': ['pk'],
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='Server',
            fields=[
                ('name_cached', models.TextField(blank=True, editable=False)),
                ('guild_id',
                 models.BigIntegerField(primary_key=True,
                                        serialize=False,
                                        unique=True)),
                ('votes', models.BigIntegerField(blank=True, null=True)),
                ('webhook_type', models.TextField(blank=True, null=True)),
                ('webhook', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('long_description', models.TextField(blank=True, null=True)),
                ('html_long_description',
                 models.BooleanField(blank=True, null=True)),
                ('css', models.TextField(blank=True, null=True)),
                ('api_token',
                 models.TextField(blank=True, null=True, unique=True)),
                ('website', models.TextField(blank=True, null=True)),
                ('tags',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('certified', models.BooleanField(blank=True, null=True)),
                ('created_at', models.BigIntegerField(blank=True, null=True)),
                ('banned', models.BooleanField(blank=True, null=True)),
                ('invite_amount', models.IntegerField(blank=True, null=True)),
                ('user_provided_invite',
                 models.BooleanField(blank=True, null=True)),
                ('invite_code', models.TextField(blank=True, null=True)),
            ],
            options={
                'db_table': 'servers',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='ULABotList',
            fields=[
                ('icon', models.TextField(blank=True, null=True)),
                ('url',
                 models.TextField(primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('api_url', models.TextField(blank=True, null=True)),
                ('discord', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('supported_features',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.IntegerField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('api_token',
                 models.TextField(
                     default=uuid.UUID('ae6555a1-afd5-4be3-bbec-8330c079ba19'))
                 ),
                ('queue', models.BooleanField(default=False)),
                ('owners',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.BigIntegerField(),
                     default=list,
                     size=None)),
            ],
            options={
                'db_table': 'bot_list',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='ULABotListApi',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('method',
                 models.IntegerField(choices=[(1, 'GET'), (2, 'POST'),
                                              (3, 'PATCH'), (4, 'PUT'),
                                              (5, 'DELETE')],
                                     default=1)),
                ('feature',
                 models.IntegerField(choices=[(1, 'Get Bot'),
                                              (2, 'Post Stats')],
                                     default=1)),
                ('supported_fields',
                 models.JSONField(
                     blank=True,
                     help_text=
                     'Format of each key, valae is NGBB_KEY: LIST_KEY where NGBB_KEY is the key used by NGBB and LIST_KEY is the key used by the list',
                     null=True)),
                ('api_path', models.TextField(default='')),
            ],
            options={
                'db_table': 'bot_list_api',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='ULABotListFeature',
            fields=[
                ('feature_id',
                 models.IntegerField(primary_key=True, serialize=False)),
                ('name', models.TextField(unique=True)),
                ('iname',
                 models.TextField(unique=True, verbose_name='Internal Name')),
                ('description', models.TextField(blank=True, null=True)),
                ('positive',
                 models.IntegerField(
                     choices=[(0, 'Negative'), (1, 'Positive'), (2,
                                                                 'Neutral')])),
            ],
            options={
                'db_table': 'bot_list_feature',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('user_id',
                 models.BigIntegerField(primary_key=True, serialize=False)),
                ('api_token', models.TextField(blank=True, null=True)),
                ('coins',
                 models.IntegerField(
                     default=0,
                     help_text=
                     'Changing this without permission from a higher up (Admin+) = Potential demotion that is possibly public as well. Admins can ignore this but do not abuse your power or the same will apply to you.'
                 )),
                ('vote_epoch', models.BigIntegerField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('certified', models.BooleanField(blank=True, null=True)),
                ('badges',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('username', models.TextField(blank=True, null=True)),
                ('avatar', models.TextField(blank=True, null=True)),
                ('css', models.TextField(blank=True, null=True)),
                ('banned', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'users',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='Vanity',
            fields=[
                ('type', models.IntegerField(blank=True, null=True)),
                ('vanity_url', models.TextField(blank=True, unique=True)),
                ('redirect',
                 models.BigIntegerField(blank=True,
                                        editable=False,
                                        primary_key=True,
                                        serialize=False,
                                        unique=True)),
                ('redirect_text',
                 models.TextField(blank=True, null=True, unique=True)),
            ],
            options={
                'db_table': 'vanity',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='DjangoContentType',
            fields=[
                ('contenttype_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='contenttypes.contenttype')),
            ],
            bases=('contenttypes.contenttype', ),
            managers=[
                ('objects',
                 django.contrib.contenttypes.models.ContentTypeManager()),
            ],
        ),
        migrations.CreateModel(
            name='HistoricalUser',
            fields=[
                ('user_id', models.BigIntegerField(db_index=True)),
                ('api_token', models.TextField(blank=True, null=True)),
                ('coins',
                 models.IntegerField(
                     default=0,
                     help_text=
                     'Changing this without permission from a higher up (Admin+) = Potential demotion that is possibly public as well. Admins can ignore this but do not abuse your power or the same will apply to you.'
                 )),
                ('vote_epoch', models.BigIntegerField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('certified', models.BooleanField(blank=True, null=True)),
                ('badges',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('username', models.TextField(blank=True, null=True)),
                ('avatar', models.TextField(blank=True, null=True)),
                ('css', models.TextField(blank=True, null=True)),
                ('banned', models.IntegerField(blank=True, null=True)),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical user',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalULABotListFeature',
            fields=[
                ('feature_id', models.IntegerField(db_index=True)),
                ('name', models.TextField(db_index=True)),
                ('iname',
                 models.TextField(db_index=True,
                                  verbose_name='Internal Name')),
                ('description', models.TextField(blank=True, null=True)),
                ('positive',
                 models.IntegerField(
                     choices=[(0, 'Negative'), (1, 'Positive'), (2,
                                                                 'Neutral')])),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical ula bot list feature',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalULABotListApi',
            fields=[
                ('id', models.IntegerField(blank=True, db_index=True)),
                ('method',
                 models.IntegerField(choices=[(1, 'GET'), (2, 'POST'),
                                              (3, 'PATCH'), (4, 'PUT'),
                                              (5, 'DELETE')],
                                     default=1)),
                ('feature',
                 models.IntegerField(choices=[(1, 'Get Bot'),
                                              (2, 'Post Stats')],
                                     default=1)),
                ('supported_fields',
                 models.JSONField(
                     blank=True,
                     help_text=
                     'Format of each key, valae is NGBB_KEY: LIST_KEY where NGBB_KEY is the key used by NGBB and LIST_KEY is the key used by the list',
                     null=True)),
                ('api_path', models.TextField(default='')),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
                ('url',
                 models.ForeignKey(
                     blank=True,
                     db_column='url',
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='fladmin.ulabotlist')),
            ],
            options={
                'verbose_name': 'historical ula bot list api',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalULABotList',
            fields=[
                ('icon', models.TextField(blank=True, null=True)),
                ('url', models.TextField(db_index=True)),
                ('api_url', models.TextField(blank=True, null=True)),
                ('discord', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('supported_features',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.IntegerField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('api_token',
                 models.TextField(
                     default=uuid.UUID('ae6555a1-afd5-4be3-bbec-8330c079ba19'))
                 ),
                ('queue', models.BooleanField(default=False)),
                ('owners',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.BigIntegerField(),
                     default=list,
                     size=None)),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical ula bot list',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalBot',
            fields=[
                ('bot_id', models.BigIntegerField(db_index=True)),
                ('prefix', models.CharField(max_length=9)),
                ('owner',
                 models.BigIntegerField(
                     help_text=
                     'Do not change a owner/perform a ownership transfer without permission from both the old and new owner'
                 )),
                ('votes',
                 models.BigIntegerField(
                     blank=True,
                     help_text=
                     'Changing this for no reason may/will lead to punishment such as getting kicked off the staff team or demoted or temporary forced LOA (Leave of absence)',
                     null=True)),
                ('servers', models.BigIntegerField(blank=True, null=True)),
                ('shard_count', models.BigIntegerField(blank=True, null=True)),
                ('bot_library', models.CharField(max_length=32)),
                ('webhook',
                 models.CharField(blank=True, max_length=1024, null=True)),
                ('webhook_type',
                 models.CharField(choices=[('VOTE', 'Vote'),
                                           ('DISCORD', 'Discord Integration'),
                                           ('FC', 'Fates Client')],
                                  max_length=10)),
                ('description', models.CharField(max_length=105)),
                ('api_token',
                 models.CharField(db_index=True,
                                  default=uuid.uuid4,
                                  max_length=255)),
                ('website',
                 models.CharField(blank=True, max_length=1024, null=True)),
                ('discord',
                 models.CharField(blank=True, max_length=32, null=True)),
                ('tags',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(), size=None)),
                ('certified', models.BooleanField()),
                ('queue',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Use fateslist.xyz main admin console to verify bots')),
                ('banner',
                 models.CharField(blank=True, max_length=1024, null=True)),
                ('created_at', models.BigIntegerField(blank=True, null=True)),
                ('invite',
                 models.CharField(blank=True, max_length=256, null=True)),
                ('banned',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Use fateslist.xyz main admin console to ban or unban bots'
                 )),
                ('disabled',
                 models.BooleanField(blank=True, help_text='unused',
                                     null=True)),
                ('github',
                 models.CharField(blank=True, max_length=256, null=True)),
                ('extra_owners',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.BigIntegerField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('features',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('private', models.BooleanField(blank=True, null=True)),
                ('html_long_description',
                 models.BooleanField(blank=True, null=True)),
                ('invite_amount', models.IntegerField(blank=True, null=True)),
                ('user_count', models.BigIntegerField(blank=True, null=True)),
                ('css', models.TextField(blank=True, null=True)),
                ('shards',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.IntegerField(),
                     blank=True,
                     null=True,
                     size=None)),
                ('donate',
                 models.CharField(blank=True, max_length=256, null=True)),
                ('username_cached',
                 models.CharField(blank=True, editable=False, max_length=32)),
                ('long_description', models.TextField()),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical bot',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]