Beispiel #1
0
class Version(models.Model):
    content = models.ForeignKey('Content', related_name='versions', on_delete=models.CASCADE)

    author = models.ForeignKey(
            'gestalten.Gestalt', related_name='versions', on_delete=models.PROTECT)
    text = models.TextField()
    time_created = models.DateTimeField(auto_now_add=True)
Beispiel #2
0
class GestaltSetting(models.Model):
    class Meta:
        unique_together = ('gestalt', 'category', 'name')

    gestalt = models.ForeignKey('gestalten.Gestalt', on_delete=models.CASCADE)
    category = models.CharField(max_length=255, blank=True)
    name = models.CharField(max_length=255)
    value = models.TextField()
Beispiel #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('custom_catalog', '0007_auto_20200218_0501'),
    ]

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(verbose_name='\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f')),
                ('is_checked_out', models.BooleanField(default=False, verbose_name='\u0417\u0430\u043a\u0430\u0437 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d')),
            ],
            options={
                'ordering': ('-created_at',),
                'verbose_name': '\u041a\u043e\u0440\u0437\u0438\u043d\u0430',
                'verbose_name_plural': '\u041a\u043e\u0440\u0437\u0438\u043d\u044b',
            },
        ),
        migrations.CreateModel(
            name='CartItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, max_digits=18, verbose_name='\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0442\u043e\u0432\u0430\u0440\u0430')),
                ('quantity', models.PositiveIntegerField(default=1, verbose_name='\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e')),
                ('object_id', models.PositiveIntegerField()),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='custom_order.Cart', verbose_name='\u041a\u043e\u0440\u0437\u0438\u043d\u0430')),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'ordering': ('cart',),
                'verbose_name': '\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u0440\u0437\u0438\u043d\u044b',
                'verbose_name_plural': '\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0440\u0437\u0438\u043d\u044b',
            },
            managers=[
                ('objects', django.contrib.contenttypes.models.ContentTypeManager()),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('confirmed', models.BooleanField(default=False, verbose_name='\u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d')),
                ('subject', models.IntegerField(choices=[(0, '\u0414\u043b\u044f \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0438\u0446'), (1, '\u0414\u043b\u044f \u044e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0438\u0446')], verbose_name='\u0441\u0443\u0431\u044a\u0435\u043a\u0442')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='\u0414\u0430\u0442\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f')),
                ('company', models.CharField(blank=True, max_length=255, null=True, verbose_name='\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f')),
                ('full_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='\u0424.\u0418.\u041e.(\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u043e\u0435 \u043b\u0438\u0446\u043e)')),
                ('inn', models.CharField(blank=True, max_length=255, null=True, verbose_name='\u0418\u041d\u041d')),
                ('phone', models.CharField(blank=True, max_length=255, null=True, verbose_name='\u0422\u0435\u043b\u0435\u0444\u043e\u043d')),
                ('email', models.EmailField(max_length=254, verbose_name='E-mail')),
                ('payment_type', models.IntegerField(choices=[(0, '\u041d\u0430\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0447\u0435\u0442'), (1, '\u0411\u0435\u0437\u043d\u0430\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0447\u0435\u0442')], verbose_name='\u0421\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u043b\u0430\u0442\u044b')),
                ('comment', models.TextField(blank=True, null=True, verbose_name='\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u0437\u0430\u043a\u0430\u0437\u0443')),
                ('delivery_type', models.IntegerField(choices=[(0, '\u0421\u0430\u043c\u043e\u0432\u044b\u0432\u043e\u0437'), (1, '\u0414\u043e\u0441\u0442\u0430\u0432\u043a\u0430')], verbose_name='\u0421\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438')),
                ('city', models.CharField(blank=True, max_length=255, null=True, verbose_name='\u0413\u043e\u0440\u043e\u0434')),
                ('address', models.CharField(blank=True, max_length=500, null=True, verbose_name='\u0410\u0434\u0440\u0435\u0441')),
                ('file', models.FileField(blank=True, null=True, upload_to=b'uploads/orders', verbose_name='\u0424\u0430\u0439\u043b')),
            ],
            options={
                'ordering': ('-created_at',),
                'verbose_name': '\u0417\u0430\u043a\u0430\u0437',
                'verbose_name_plural': '\u0417\u0430\u043a\u0430\u0437\u044b',
            },
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, help_text='\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043a\u0430\u0437\u0430', max_digits=18, verbose_name='\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0442\u043e\u0432\u0430\u0440\u0430')),
                ('quantity', models.DecimalField(decimal_places=0, max_digits=18, verbose_name='\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e')),
                ('product_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u0430')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='custom_order.Order', verbose_name='\u0417\u0430\u043a\u0430\u0437')),
                ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='custom_catalog.Product', verbose_name='\u0422\u043e\u0432\u0430\u0440')),
            ],
            options={
                'verbose_name': '\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u043a\u0430\u0437\u0430',
                'verbose_name_plural': '\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0437\u0430\u043a\u0430\u0437\u0430',
            },
        ),
        migrations.CreateModel(
            name='OrderStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435')),
                ('is_initial', models.BooleanField(default=False, verbose_name='\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439')),
                ('is_closing', models.BooleanField(default=False, verbose_name='\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439')),
                ('index_number', models.IntegerField(default=0, verbose_name='\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u0442\u0430\u0442\u0443\u0441\u0430')),
            ],
            options={
                'verbose_name': '\u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043a\u0430\u0437\u0430',
                'verbose_name_plural': '\u0421\u0442\u0430\u0442\u0443\u0441\u044b \u0437\u0430\u043a\u0430\u0437\u0430',
            },
        ),
        migrations.AddField(
            model_name='order',
            name='status',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='custom_order.OrderStatus', verbose_name='\u0421\u0442\u0430\u0442\u0443\u0441'),
        ),
        migrations.AddField(
            model_name='cart',
            name='order',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='custom_order.Order'),
        ),
    ]
Beispiel #4
0
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
Beispiel #5
0
class LogEntry(models.Model):
    action_time = models.DateTimeField(
        _('action time'),
        default=timezone.now,
        editable=False,
    )
    user = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        models.CASCADE,
        verbose_name=_('user'),
    )
    content_type = models.ForeignKey(
        django.contrib.contenttypes.models.ContentType,
        models.SET_NULL,
        verbose_name=_('content type'),
        blank=True,
        null=True,
    )
    object_id = models.TextField(_('object id'), blank=True, null=True)
    # Translators: 'repr' means representation (https://docs.python.org/3/library/functions.html#repr)
    object_repr = models.CharField(_('object repr'), max_length=200)
    action_flag = models.PositiveSmallIntegerField(_('action flag'))
    # change_message is either a string or a JSON structure
    change_message = models.TextField(_('change message'), blank=True)

    objects = LogEntryManager()

    class Meta:
        verbose_name = _('log entry')
        verbose_name_plural = _('log entries')
        db_table = 'django_admin_log'
        ordering = ('-action_time', )

    def __repr__(self):
        return str(self.action_time)

    def __str__(self):
        if self.is_addition():
            return gettext('Added "%(object)s".') % {
                'object': self.object_repr
            }
        elif self.is_change():
            return gettext('Changed "%(object)s" - %(changes)s') % {
                'object': self.object_repr,
                'changes': self.get_change_message(),
            }
        elif self.is_deletion():
            return gettext('Deleted "%(object)s."') % {
                'object': self.object_repr
            }

        return gettext('LogEntry Object')

    def is_addition(self):
        return self.action_flag == ADDITION

    def is_change(self):
        return self.action_flag == CHANGE

    def is_deletion(self):
        return self.action_flag == DELETION

    def get_change_message(self):
        """
        If self.change_message is a JSON structure, interpret it as a change
        string, properly translated.
        """
        if self.change_message and self.change_message[0] == '[':
            try:
                change_message = json.loads(self.change_message)
            except ValueError:
                return self.change_message
            messages = []
            for sub_message in change_message:
                if 'added' in sub_message:
                    if sub_message['added']:
                        sub_message['added']['name'] = gettext(
                            sub_message['added']['name'])
                        messages.append(
                            gettext('Added {name} "{object}".').format(
                                **sub_message['added']))
                    else:
                        messages.append(gettext('Added.'))

                elif 'changed' in sub_message:
                    sub_message['changed']['fields'] = get_text_list(
                        sub_message['changed']['fields'], gettext('and'))
                    if 'name' in sub_message['changed']:
                        sub_message['changed']['name'] = gettext(
                            sub_message['changed']['name'])
                        messages.append(
                            gettext('Changed {fields} for {name} "{object}".').
                            format(**sub_message['changed']))
                    else:
                        messages.append(
                            gettext('Changed {fields}.').format(
                                **sub_message['changed']))

                elif 'deleted' in sub_message:
                    sub_message['deleted']['name'] = gettext(
                        sub_message['deleted']['name'])
                    messages.append(
                        gettext('Deleted {name} "{object}".').format(
                            **sub_message['deleted']))

            change_message = ' '.join(msg[0].upper() + msg[1:]
                                      for msg in messages)
            return change_message or gettext('No fields changed.')
        else:
            return self.change_message

    def get_edited_object(self):
        """Return the edited object represented by this log entry."""
        return self.content_type.get_object_for_this_type(pk=self.object_id)

    def get_admin_url(self):
        """
        Return the admin URL to edit the object represented by this log entry.
        """
        if self.content_type and self.object_id:
            url_name = 'admin:%s_%s_change' % (self.content_type.app_label,
                                               self.content_type.model)
            try:
                return reverse(url_name, args=(quote(self.object_id), ))
            except NoReverseMatch:
                pass
        return None
Beispiel #6
0
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),
        ),
    ]