class Migration(migrations.Migration):

    dependencies = [
        ('user', '0004_auto_20200716_1903'),
    ]

    operations = [
        migrations.AlterField(
            model_name='user',
            name='cpf',
            field=models.CharField(blank=True, max_length=14, null=True, verbose_name='CPF'),
        ),
        migrations.CreateModel(
            name='Complaint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('created_at', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='criado em')),
                ('updated_at', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modificado em')),
                ('description', models.CharField(blank=True, max_length=300, null=True, verbose_name='Descrição')),
                ('address', models.CharField(blank=True, max_length=30, null=True, verbose_name='Endereço do ocorrido')),
                ('when_happen', models.DateField(blank=True, null=True, verbose_name='Dia do ocorrido')),
                ('time_when_happen', models.TimeField(blank=True, null=True, verbose_name='Horário do ocorrido')),
                ('bus_number', models.CharField(blank=True, max_length=30, null=True, verbose_name='Número do ônibus')),
                ('bus_license_plate', models.CharField(blank=True, max_length=30, null=True, verbose_name='Placa do ônibus')),
                ('video_or_image', models.FileField(blank=True, null=True, upload_to=apps.user.models.user_file_directory_path, verbose_name='Vídeo ou imagem do ocorrido')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
示例#2
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('campus_sibsau', '0005_alter_sportclub_phone'),
    ]

    operations = [
        migrations.AlterField(
            model_name='joiningensemble',
            name='user',
            field=models.ForeignKey(default=apps.user.models.User.get_default_id, on_delete=django.db.models.deletion.SET_DEFAULT, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('tickets', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='purchase',
            name='buyer',
            field=models.ForeignKey(
                default=apps.user.models.User.get_default_id,
                on_delete=django.db.models.deletion.SET_DEFAULT,
                to=settings.AUTH_USER_MODEL,
                verbose_name='Покупатель'),
        ),
    ]
示例#4
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('support', '0003_alter_faq_answer'),
    ]

    operations = [
        migrations.AlterField(
            model_name='faq',
            name='user',
            field=models.ForeignKey(
                default=apps.user.models.User.get_default_id,
                null=True,
                on_delete=django.db.models.deletion.SET_DEFAULT,
                to=settings.AUTH_USER_MODEL),
        ),
    ]
示例#5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('first_name',
                 models.CharField(blank=True,
                                  db_index=True,
                                  help_text='First name.',
                                  max_length=120,
                                  null=True,
                                  verbose_name='First name')),
                ('last_name',
                 models.CharField(blank=True,
                                  db_index=True,
                                  help_text='Last name.',
                                  max_length=120,
                                  null=True,
                                  verbose_name='Last name')),
                ('birthday',
                 models.DateField(blank=True,
                                  db_index=True,
                                  help_text='Date of birth.',
                                  null=True,
                                  verbose_name='Birthday')),
                ('username',
                 models.CharField(
                     db_index=True,
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     '32 characters or fewer. Letters, digits and @/./+/-/_.',
                     max_length=32,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='Username')),
                ('gender',
                 models.PositiveSmallIntegerField(
                     blank=True,
                     choices=[(100, 'Male'), (200, 'Female')],
                     db_index=True,
                     help_text='Gender (100 - Male, 200 - Female).',
                     null=True,
                     verbose_name='Gender')),
                ('email',
                 models.EmailField(db_index=True,
                                   help_text='User email.',
                                   max_length=254,
                                   unique=True,
                                   verbose_name='E-mail address')),
                ('photo',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to='users',
                     validators=[apps.user.validators.validate_profile_pic],
                     verbose_name='Photo')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'User',
                'verbose_name_plural': 'Users',
            },
            managers=[
                ('objects', apps.user.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ChangeEmailCode',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code',
                 models.CharField(db_index=True,
                                  default=apps.user.utils.generate_pin_code,
                                  max_length=4,
                                  verbose_name='Code')),
                ('new_email',
                 models.EmailField(blank=True,
                                   db_index=True,
                                   max_length=254,
                                   null=True,
                                   verbose_name='New email')),
                ('time_expired',
                 models.DateTimeField(
                     db_index=True,
                     default=apps.user.utils.default_time_expired,
                     verbose_name='Time expired')),
                ('created',
                 models.DateTimeField(auto_now_add=True,
                                      db_index=True,
                                      verbose_name='Creation time')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='email_code',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
            options={
                'verbose_name': 'Change email code',
                'verbose_name_plural': 'Change email codes',
            },
        ),
        migrations.CreateModel(
            name='UserActivationCode',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code',
                 models.CharField(db_index=True,
                                  default=apps.user.utils.generate_pin_code,
                                  max_length=4,
                                  verbose_name='Code')),
                ('time_expired',
                 models.DateTimeField(
                     db_index=True,
                     default=apps.user.utils.default_time_expired,
                     verbose_name='Time expired')),
                ('created',
                 models.DateTimeField(auto_now_add=True,
                                      db_index=True,
                                      verbose_name='Creation time')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='code',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
            options={
                'verbose_name': 'User activation code',
                'verbose_name_plural': 'User activation codes',
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='FileModel',
            fields=[
                ('fileID',
                 models.CharField(max_length=30,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='文件ID')),
                ('file',
                 models.FileField(upload_to=apps.user.models.user_data_path,
                                  verbose_name='用户上传文件')),
                ('fileStats',
                 models.CharField(default='正在计算.......',
                                  max_length=20,
                                  verbose_name='文件状态')),
                ('fileScore', models.FloatField(null=True,
                                                verbose_name='文件得分')),
            ],
            options={
                'verbose_name': '文件表',
                'db_table': 'Files',
            },
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('groupID',
                 models.CharField(max_length=20,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='队伍ID')),
                ('groupName',
                 models.CharField(max_length=20, verbose_name='队伍名称')),
                ('groupCount',
                 models.IntegerField(default=1, verbose_name='队伍人数')),
            ],
            options={
                'verbose_name': '队伍表',
                'db_table': 'Groups',
            },
        ),
        migrations.CreateModel(
            name='GroupGrade',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('Time',
                 models.DateTimeField(auto_now_add=True, verbose_name='提交时间')),
                ('groupScore', models.FloatField(verbose_name='得分')),
            ],
            options={
                'verbose_name': '队伍得分表',
                'db_table': 'GroupGrade',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('userID',
                 models.CharField(max_length=20,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='用户ID')),
                ('groupID',
                 models.CharField(default='',
                                  max_length=20,
                                  verbose_name='所在队伍ID')),
                ('userName',
                 models.CharField(max_length=20,
                                  unique=True,
                                  verbose_name='用户名')),
                ('passWord',
                 models.CharField(max_length=16,
                                  validators=[apps.user.models.validate_even],
                                  verbose_name='用户密码')),
                ('userEmail',
                 models.EmailField(max_length=254, verbose_name='用户邮箱')),
                ('userPhone', models.BigIntegerField(verbose_name='手机')),
                ('userSex',
                 models.CharField(blank=True,
                                  choices=[('m', 'male'), ('f', 'female')],
                                  max_length=4,
                                  verbose_name='性别')),
                ('userNo', models.CharField(max_length=11, verbose_name='学号')),
                ('userSchool',
                 models.CharField(max_length=10, verbose_name='学校')),
                ('userStats', models.CharField(max_length=5)),
            ],
            options={
                'verbose_name': '用户表',
                'db_table': 'Users',
            },
        ),
        migrations.AddIndex(
            model_name='user',
            index=models.Index(fields=['userID'],
                               name='Users_userID_80d74e_idx'),
        ),
        migrations.AddField(
            model_name='groupgrade',
            name='groupID',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='user.Group',
                verbose_name='队伍ID'),
        ),
        migrations.AddField(
            model_name='group',
            name='groupHeadID',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='user.User',
                verbose_name='队长ID'),
        ),
        migrations.AddField(
            model_name='filemodel',
            name='uploadGroupID',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='user.Group',
                verbose_name='所属队伍'),
        ),
        migrations.AddField(
            model_name='filemodel',
            name='uploadUserID',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='user.User',
                verbose_name='提交人ID'),
        ),
        migrations.AddIndex(
            model_name='group',
            index=models.Index(fields=['groupID'],
                               name='Groups_groupID_bd25c9_idx'),
        ),
    ]
示例#7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('email',
                 models.EmailField(
                     db_index=True,
                     max_length=254,
                     unique=True,
                     validators=[django.core.validators.EmailValidator()],
                     verbose_name='email address')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'User with this username already exists.'
                     },
                     help_text=
                     'Required. 30 characters or fewer. Letters, numbers and @/./+/-/_ characters',
                     max_length=30,
                     unique=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             re.compile('^[\\w.+-]+$'),
                             'Enter a valid username.', 'invalid')
                     ],
                     verbose_name='username')),
                ('full_name',
                 models.CharField(max_length=60, verbose_name='full name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('photo',
                 models.FileField(
                     blank=True,
                     upload_to=apps.user.utils.UploadDir('photo'))),
                ('age', models.PositiveSmallIntegerField(blank=True,
                                                         null=True)),
                ('gender',
                 models.CharField(choices=[('male', 'Male'),
                                           ('female', 'Female')],
                                  max_length=6)),
                ('address',
                 models.CharField(max_length=255,
                                  null=True,
                                  verbose_name='address')),
                ('phone',
                 models.CharField(max_length=255,
                                  null=True,
                                  verbose_name='phone')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', apps.user.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Hashtag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('description', models.TextField()),
                ('primary_picture',
                 models.ImageField(
                     upload_to=apps.user.utils.UploadDir('product_images'))),
            ],
        ),
        migrations.CreateModel(
            name='TaskRun',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('task_label',
                 models.CharField(max_length=30, verbose_name='task label')),
                ('started_at', models.DateTimeField(auto_now_add=True)),
                ('terminated_at',
                 models.DateTimeField(blank=True, default=None, null=True)),
            ],
            options={
                'ordering': ('-started_at', ),
            },
        ),
        migrations.CreateModel(
            name='Trending',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='TrendingProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('score',
                 models.DecimalField(decimal_places=2, default=0,
                                     max_digits=9)),
                ('trending',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='user.Trending')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-score', ),
            },
        ),
        migrations.CreateModel(
            name='TrendingHashtag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('score',
                 models.DecimalField(decimal_places=2, default=0,
                                     max_digits=9)),
                ('hashtag',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='user.Hashtag')),
                ('trending',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='user.Trending')),
            ],
            options={
                'ordering': ('-score', ),
            },
        ),
        migrations.AddField(
            model_name='trending',
            name='hashtags',
            field=models.ManyToManyField(through='user.TrendingHashtag',
                                         to='user.Hashtag'),
        ),
        migrations.AddField(
            model_name='trending',
            name='profiles',
            field=models.ManyToManyField(through='user.TrendingProfile',
                                         to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='ProductPicture',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('picture',
                 models.ImageField(
                     upload_to=apps.user.utils.UploadDir('product_images'))),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='pictures',
                                   to='user.Product')),
            ],
        ),
        migrations.CreateModel(
            name='Follow',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('from_user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='from_user',
                                   to=settings.AUTH_USER_MODEL)),
                ('to_user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='to_user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='followers',
            field=models.ManyToManyField(related_name='following',
                                         through='user.Follow',
                                         to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(
                blank=True,
                help_text=
                'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Group',
                verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
    ]
示例#8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('org', '0001_initial'),
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('username',
                 models.CharField(max_length=32, null=True, unique=True)),
                ('full_name',
                 models.CharField(blank=True, max_length=128, null=True)),
                ('designation',
                 models.CharField(blank=True, max_length=128, null=True)),
                ('email',
                 models.EmailField(blank=True, max_length=254, null=True)),
                ('phone', models.CharField(blank=True,
                                           max_length=16,
                                           null=True)),
                ('is_superuser', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('role',
                 models.PositiveSmallIntegerField(blank=True,
                                                  choices=[(3, 'Leader'),
                                                           (0, 'Organizer'),
                                                           (1, 'Manager'),
                                                           (2, 'Employee')],
                                                  default=2)),
                ('is_present', models.BooleanField(default=False)),
                ('is_awol', models.BooleanField(default=False)),
                ('active_task', models.IntegerField(default=0)),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('image', models.URLField(blank=True, null=True)),
                ('domain',
                 models.PositiveSmallIntegerField(choices=[
                     (4, 'Insurance'), (0, 'Sales'),
                     (3, 'Rent-a-car/Ride sharing'), (6, 'Sales(Pharma)'),
                     (2, 'Installation/Maintenance/Repair'),
                     (1, 'Delivery Service'), (5, 'Others')
                 ],
                                                  default=0)),
                ('fb_token', models.TextField(blank=True, default='')),
                ('lft',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('org',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='org.Organization')),
                ('parent',
                 mptt.fields.TreeForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='children',
                     to=settings.AUTH_USER_MODEL)),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', apps.user.models.SimpleUserManager()),
            ],
        ),
        migrations.CreateModel(
            name='DataUsage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('megabytes', models.FloatField(default=0.0)),
                ('timestamp',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('agent',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
示例#9
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('campus_sibsau', '0006_alter_joiningensemble_user'),
    ]

    operations = [
        migrations.CreateModel(
            name='Faculty',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255, verbose_name='Название')),
                ('logo',
                 models.ImageField(upload_to='campus/faculty/logo',
                                   verbose_name='Логотип')),
                ('about', models.TextField(verbose_name='Описание')),
                ('direction',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Направление факультета')),
                ('learning',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Обучение')),
                ('vk_link',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='Ссылка на вк')),
                ('contacts',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Контакты')),
                ('instagram_link',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='Ссылка на инстаграм')),
                ('is_main_page',
                 models.BooleanField(default=False,
                                     verbose_name='Главная страница')),
                ('page_vk',
                 models.URLField(
                     blank=True,
                     help_text=
                     'Ссылка обязательно должна быть в формате https://vk.com/id1234.\n                       Если она будет иметь другой формат, то нельзя будет отправлять заявки на вступление',
                     null=True,
                     verbose_name='Председатель факультета во вконтакте')),
            ],
            options={
                'verbose_name': 'Факультет',
                'verbose_name_plural': 'Факультеты',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='JoiningFaculty',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('fio', models.CharField(max_length=31, verbose_name='ФИО')),
                ('institute',
                 models.CharField(max_length=256, verbose_name='Институт')),
                ('group',
                 models.CharField(max_length=256, verbose_name='Группа')),
                ('id_vk',
                 models.CharField(max_length=128,
                                  verbose_name='ID во ВКонтакте')),
                ('hobbies', models.TextField(verbose_name='Увлечения')),
                ('reason',
                 models.TextField(
                     verbose_name='Причина вступления в факультет')),
                ('create_data',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Дата вступления')),
                ('faculty',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='campus_sibsau.faculty',
                                   verbose_name='Факультет')),
                ('user',
                 models.ForeignKey(
                     default=apps.user.models.User.get_default_id,
                     on_delete=django.db.models.deletion.SET_DEFAULT,
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='Пользователь')),
            ],
            options={
                'verbose_name': 'Заявка в факультет',
                'verbose_name_plural': 'Заявки в факультеты',
            },
        ),
    ]