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)
class PermissionToken(models.Model): """ permission token are bound to a user and a specific resource Permission tokens are used for accessing resources like non-public calendars without exposing an account password. Permission tokens are application/feature-specific. Every application/feature needs to define its own unique string (see 'feature_key' below). Every permission tokens connects a specific user identity (gestalt) to a specific database entity for a specific purpose. A permission token may only be used for authentication - never for authorization. After retrieving a permission token for a specific purpose, you need to verify that the authenticated user is really allowed to access the given resource. """ gestalt = models.ForeignKey('gestalten.Gestalt', on_delete=models.CASCADE) # FIXME: secret_key should be unique secret_key = models.CharField(max_length=PERMISSION_TOKEN_LENGTH, default=generate_token) time_created = models.DateTimeField(auto_now_add=True) # Every feature (e.g. the calendar) defines its own unique string describing its permission # token (e.g. "calendar-read"). feature_key = models.CharField(max_length=32) target_type = models.ForeignKey(contenttypes_models.ContentType, on_delete=models.CASCADE) target_id = models.PositiveIntegerField() target = GenericForeignKey('target_type', 'target_id') @classmethod def get_permission_token(cls, gestalt, target, feature_key, create_if_missing=False): target_object_type = contenttypes_models.ContentType.objects.get_for_model( target) token = PermissionToken.objects.filter( gestalt=gestalt, feature_key=feature_key, target_type=target_object_type.id, target_id=target.id).first() if token: return token elif create_if_missing: new_obj = PermissionToken(gestalt=gestalt, target=target, feature_key=feature_key) new_obj.save() return new_obj else: return None @classmethod def remove_permission_token(cls, gestalt, target, feature_key): token = cls.get_permission_token(gestalt, target, feature_key) if token: token.delete()
class Reference(models.Model): content_type = models.ForeignKey(ContentType) local_object_id = models.CharField(max_length=20) remote_object_id = models.CharField(max_length=20) class Meta: #app_label = 'Reference' unique_together = ('content_type', 'local_object_id')
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()
class ChangeLog(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.CharField(max_length=20) object = fields.GenericForeignKey() date = models.DateTimeField(auto_now=True) action = models.PositiveSmallIntegerField(choices=ACTIONS) #class Meta: #app_label = 'ChangeLog' def __unicode__(self): return u'ChangeLog for %s (%s)' % (unicode(self.object), self.get_action_display())
class PostNotification(models.Model): id = models.AutoField(primary_key=True, unique=True, db_column='id') actor = models.ForeignKey( User, on_delete=models.CASCADE, related_name='notify_from', db_column='actor', ) action = models.CharField(max_length=1000, db_column='action') recipient = models.ForeignKey( User, on_delete=models.CASCADE, related_name='notify_to', db_column='recipient', ) post = models.ForeignKey( Post, on_delete=models.CASCADE, related_name='notify_of', db_column='post', ) notified = models.DateTimeField(auto_now_add=True, db_column='notified') def __str__(self): context = { 'actor': self.actor, 'action': self.action, 'recipient': self.recipient, 'post': self.post, 'notified': self.notified, } return u"%(actor)s %(action)s %(recipient)s's %(post)s on %(notified)s." % context class Meta: db_table = 'postnotification' managed = False
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
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'), ), ]
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
class Migration(migrations.Migration): initial = True dependencies = [ ("contenttypes", "0002_remove_content_type_name"), ] operations = [ migrations.CreateModel( name="AppGroup", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("order", models.PositiveIntegerField(db_index=True, editable=False)), ("name", models.CharField(max_length=200, verbose_name="name")), ("slug", models.SlugField(unique=True, verbose_name="slug")), ], options={ "verbose_name_plural": "application groups", "verbose_name": "application group", "abstract": False, "ordering": ("order",), }, ), migrations.CreateModel( name="AppLink", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("order", models.PositiveIntegerField(db_index=True, editable=False)), ("name", models.CharField(max_length=200)), ("link", models.CharField(max_length=200)), ( "app_group", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="admin_index.AppGroup", ), ), ], options={ "verbose_name_plural": "application links", "verbose_name": "application link", "abstract": False, "ordering": ("order",), }, ), migrations.CreateModel( name="ContentTypeProxy", fields=[], options={"proxy": True, "ordering": ("app_label", "model"),}, bases=("contenttypes.contenttype",), managers=[ ("objects", django.contrib.contenttypes.models.ContentTypeManager()), ], ), migrations.AddField( model_name="appgroup", name="models", field=models.ManyToManyField(blank=True, to="admin_index.ContentTypeProxy"), ), ]
class Migration(migrations.Migration): initial = True dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateModel( name='AppGroup', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('order', models.PositiveIntegerField(db_index=True, editable=False)), ('name', models.CharField(max_length=200, verbose_name='name')), ('slug', models.SlugField(unique=True, verbose_name='slug')), ], options={ 'verbose_name_plural': 'application groups', 'verbose_name': 'application group', 'abstract': False, 'ordering': ('order', ), }, ), migrations.CreateModel( name='AppLink', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('order', models.PositiveIntegerField(db_index=True, editable=False)), ('name', models.CharField(max_length=200)), ('link', models.CharField(max_length=200)), ('app_group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='admin_index.AppGroup')), ], options={ 'verbose_name_plural': 'application links', 'verbose_name': 'application link', 'abstract': False, 'ordering': ('order', ), }, ), migrations.CreateModel( name='ContentTypeProxy', fields=[], options={ 'proxy': True, 'ordering': ('app_label', 'model'), }, bases=('contenttypes.contenttype', ), managers=[ ('objects', django.contrib.contenttypes.models.ContentTypeManager()), ], ), migrations.AddField( model_name='appgroup', name='models', field=models.ManyToManyField(blank=True, to='admin_index.ContentTypeProxy'), ), ]
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), ), ]