Ejemplo n.º 1
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('head', models.ImageField(default='user/201809/23/tx1.png', upload_to='head/%Y/%m', verbose_name='用户头像')),
                ('nick_name', models.CharField(max_length=50, verbose_name='昵称')),
                ('openid', models.CharField(blank=True, max_length=32, null=True)),
                ('session_key', models.CharField(blank=True, max_length=64, null=True)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('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': '用户信息',
                'verbose_name_plural': '用户信息',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='CompanyHring',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='创建时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('job_name', models.CharField(blank=True, max_length=16, null=True)),
                ('salary_range', models.CharField(blank=True, max_length=16, null=True)),
                ('city', models.CharField(blank=True, max_length=16, null=True)),
                ('scope_commission', models.CharField(blank=True, max_length=16, null=True)),
                ('work_des', models.TextField(blank=True, null=True)),
                ('nature', models.CharField(blank=True, max_length=32, null=True)),
                ('work_nature', models.CharField(blank=True, max_length=32, null=True)),
                ('age', models.CharField(blank=True, max_length=8, null=True)),
                ('sex', models.CharField(blank=True, max_length=8, null=True)),
                ('experience', models.CharField(blank=True, max_length=8, null=True)),
                ('certificate', models.CharField(blank=True, max_length=32, null=True)),
                ('education', models.CharField(blank=True, max_length=8, null=True)),
                ('user', models.CharField(blank=True, max_length=8, null=True)),
                ('phone', models.CharField(blank=True, max_length=16, null=True)),
                ('is_call', models.BooleanField(default=False, verbose_name='是否允许打电话')),
                ('status', models.CharField(choices=[('on', '招聘中'), ('stop', '暂停招聘'), ('full', '招满')], default='on', max_length=6)),
            ],
            options={
                'verbose_name': '岗位信息',
                'db_table': 'company_hring',
            },
        ),
        migrations.CreateModel(
            name='Position',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('job_name', models.CharField(blank=True, max_length=32, null=True)),
            ],
            options={
                'verbose_name': '职位表',
                'db_table': 'position',
            },
        ),
        migrations.CreateModel(
            name='PositionType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('job_type', models.CharField(blank=True, max_length=32, null=True)),
            ],
            options={
                'verbose_name': '职位类型表',
                'db_table': 'position_type',
            },
        ),
        migrations.CreateModel(
            name='Resume',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='创建时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('real_name', models.CharField(max_length=16, verbose_name='真实姓名')),
                ('gender', models.CharField(choices=[('male', '男'), ('female', '女')], default='female', max_length=6)),
                ('birthday', models.DateField(blank=True, null=True, verbose_name='生日')),
                ('city', models.CharField(default='', max_length=16)),
                ('mobile', models.CharField(blank=True, max_length=11, null=True, unique=True)),
                ('wx_num', models.CharField(blank=True, max_length=32, null=True, unique=True, verbose_name='微信号')),
                ('cur_status', models.CharField(blank=True, max_length=32, null=True, unique=True, verbose_name='当前身份')),
                ('entry_time', models.DateField(blank=True, null=True, verbose_name='入行时间')),
                ('pro_certificate', models.ImageField(default='pro/201809/23/tx1.png', upload_to='pro/%Y/%m', verbose_name='从业证书')),
                ('id_verify', models.ImageField(default='id/201809/23/tx1.png', upload_to='id/%Y/%m', verbose_name='身份证')),
                ('describe', models.TextField(blank=True, null=True, verbose_name='自我介绍')),
                ('hobby', models.TextField(blank=True, null=True, verbose_name='兴趣爱好')),
                ('position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Position')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': '简历表',
                'db_table': 'resume',
            },
        ),
        migrations.CreateModel(
            name='WorkExperience',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='创建时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('company_name', models.CharField(blank=True, max_length=32, null=True, verbose_name='公司名称')),
                ('entry_time', models.DateField(blank=True, null=True, verbose_name='入职时间')),
                ('resignation_time', models.DateField(blank=True, null=True, verbose_name='离职时间')),
                ('job_content', models.TextField(blank=True, max_length=128, null=True, verbose_name='工作内容')),
                ('position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Position')),
                ('resume', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Resume')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': '工作经历',
                'db_table': 'work_experience',
            },
        ),
        migrations.CreateModel(
            name='User2Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.CompanyHring')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'position_user',
            },
        ),
        migrations.CreateModel(
            name='StoreAuthentication',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='创建时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('is_verify', models.BooleanField(default=False, verbose_name='是否审核')),
                ('company_name', models.CharField(blank=True, max_length=32, null=True)),
                ('open_time', models.DateField(blank=True, null=True)),
                ('addr', models.CharField(blank=True, max_length=32, null=True)),
                ('shop_pic', models.ImageField(default='shop/201809/23/tx1.png', upload_to='shop/%Y/%m', verbose_name='店铺照片')),
                ('business_licens', models.ImageField(default='business/201809/23/tx1.png', upload_to='business/%Y/%m', verbose_name='营业执照')),
                ('name', models.CharField(blank=True, max_length=8, null=True)),
                ('sex', models.CharField(blank=True, max_length=2, null=True)),
                ('birthday', models.DateField(blank=True, null=True)),
                ('entry_time', models.DateField(blank=True, null=True)),
                ('id_verify', models.ImageField(default='id/201809/23/tx1.png', upload_to='id/%Y/%m', verbose_name='身份证')),
                ('wx', models.CharField(blank=True, max_length=16, null=True)),
                ('phone', models.CharField(blank=True, max_length=16, null=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': '店铺认证',
                'db_table': 'store_authentication',
            },
        ),
        migrations.CreateModel(
            name='SkillLabel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('skill_name', models.CharField(blank=True, max_length=16, null=True)),
                ('position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Position')),
            ],
            options={
                'verbose_name': '技能标签',
                'db_table': 'skill_label',
            },
        ),
        migrations.CreateModel(
            name='Skill2Resume',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('resume', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Resume')),
                ('skill', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.SkillLabel')),
            ],
            options={
                'db_table': 'skill_resume',
            },
        ),
        migrations.CreateModel(
            name='Resume2Store',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('resume', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Resume')),
                ('store', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.StoreAuthentication')),
            ],
            options={
                'db_table': 'store_resume',
            },
        ),
        migrations.CreateModel(
            name='Position2Resume',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.CompanyHring')),
                ('resume', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Resume')),
            ],
            options={
                'db_table': 'position_resume',
            },
        ),
        migrations.AddField(
            model_name='position',
            name='type',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.PositionType'),
        ),
        migrations.CreateModel(
            name='EducationExperience',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='创建时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('school_name', models.CharField(blank=True, max_length=32, null=True, verbose_name='学校名称')),
                ('education', models.CharField(blank=True, max_length=16, null=True, verbose_name='学历')),
                ('major', models.CharField(blank=True, max_length=16, null=True, verbose_name='专业')),
                ('entry_time', models.DateField(blank=True, null=True, verbose_name='入学时间')),
                ('graduate_time', models.DateField(blank=True, null=True, verbose_name='毕业时间')),
                ('resume', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Resume')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': '教育经历',
                'db_table': 'education_experience',
            },
        ),
        migrations.AddField(
            model_name='companyhring',
            name='company',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.StoreAuthentication'),
        ),
        migrations.AddField(
            model_name='companyhring',
            name='job',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='apply.Position'),
        ),
    ]
Ejemplo n.º 2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='HotelInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone', models.CharField(max_length=11)),
                ('address', models.CharField(max_length=128)),
                ('desc', models.CharField(max_length=150)),
                ('web', models.IntegerField(choices=[(0, '无'), (1, '有')], default=0)),
                ('service', models.TextField(max_length=150)),
                ('inquerment', models.TextField(max_length=100)),
            ],
            options={
                'db_table': 'hotel_info',
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('check_in_time', models.DateTimeField()),
                ('check_out_time', models.DateTimeField()),
                ('username', models.CharField(max_length=30, null=True)),
                ('user_nums', models.IntegerField(default=1)),
                ('order_room_num', models.IntegerField(default=1)),
                ('last_in_time', models.DateTimeField()),
                ('phone', models.CharField(max_length=11)),
                ('price', models.FloatField()),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('order_status', models.IntegerField(default=0)),
            ],
            options={
                'db_table': 'hotel_order',
            },
        ),
        migrations.CreateModel(
            name='Reflex',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=60, null=True)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('level', models.IntegerField(choices=[(0, '吐槽'), (1, '差'), (2, '一般'), (3, '很满意'), (4, '强烈推荐')], default=2)),
                ('content', models.TextField(max_length=150)),
                ('score', models.FloatField(default=6.0)),
                ('order', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='orderid', to='App.Order')),
            ],
            options={
                'db_table': 'hotel_reflex',
            },
        ),
        migrations.CreateModel(
            name='Room',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('room_status', models.IntegerField(choices=[(0, '预定'), (1, '入住'), (2, '空闲')], default=2)),
            ],
            options={
                'db_table': 'hotel_room',
            },
        ),
        migrations.CreateModel(
            name='RoomStyle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('style', models.IntegerField(default=0)),
                ('size', models.IntegerField()),
                ('num', models.IntegerField(default=10)),
                ('iswindow', models.IntegerField(choices=[(0, '无'), (1, '有')])),
                ('iswifi', models.IntegerField(choices=[(0, '无'), (1, '有')])),
                ('bathroom', models.IntegerField(choices=[(0, '无'), (1, '有')])),
                ('breakfast', models.IntegerField(choices=[(0, '无'), (1, '有')])),
                ('desc', models.TextField(max_length=100)),
                ('dorprice', models.FloatField()),
                ('webprice', models.FloatField()),
                ('huiyuanprice', models.FloatField()),
            ],
            options={
                'db_table': 'hotel_roomstyle',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('uid', models.AutoField(primary_key=True, serialize=False)),
                ('phone', models.CharField(max_length=11, null=True)),
                ('realname', models.CharField(max_length=60)),
                ('usertype', models.IntegerField(default=0, null=True)),
                ('regtime', models.DateField(auto_now_add=True)),
                ('pict', models.CharField(max_length=128, null=True)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('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={
                'db_table': 'hotel_user',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='room',
            name='typeid',
            field=models.ForeignKey(db_column='roomstyleid', on_delete=django.db.models.deletion.CASCADE, related_name='type', to='App.RoomStyle'),
        ),
        migrations.AddField(
            model_name='order',
            name='room',
            field=models.OneToOneField(db_column='roomstyle', on_delete=django.db.models.deletion.CASCADE, to='App.RoomStyle'),
        ),
        migrations.AddField(
            model_name='order',
            name='user_id',
            field=models.ForeignKey(db_column='user_id', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user', to=settings.AUTH_USER_MODEL),
        ),
    ]
Ejemplo n.º 3
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')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('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')),
                ('phone',
                 phonenumber_field.modelfields.PhoneNumberField(max_length=128,
                                                                unique=True)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('name', models.CharField(max_length=10)),
                ('birth', models.DateField(blank=True, null=True)),
                ('sns_agree', models.BooleanField(default=False)),
                ('email_agree', models.BooleanField(default=False)),
                ('hammer', models.PositiveIntegerField(default=0)),
                ('happy_cash', models.PositiveIntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('adminManager', members.manager.UserAdminManager()),
                ('normalManager', members.manager.UserNormalManager()),
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('postcode', models.CharField(max_length=6)),
                ('address', models.TextField()),
                ('detail', models.TextField()),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rating_choices_name',
                 models.CharField(choices=[('1', '루키몽'), ('2', '실버몽'),
                                           ('3', '골드몽'), ('4', '파워몽'),
                                           ('5', '슈퍼몽')],
                                  max_length=2,
                                  unique=True)),
                ('ticket_count', models.IntegerField()),
                ('cash_count', models.IntegerField()),
                ('charge_support_benefit',
                 models.IntegerField(blank=True, null=True)),
                ('rating_achieve_benefit',
                 models.IntegerField(blank=True, null=True)),
                ('happy_day_benefit', models.IntegerField(blank=True,
                                                          null=True)),
                ('hammer_benefit', models.IntegerField(blank=True)),
                ('birthday_benefit', models.IntegerField(blank=True,
                                                         null=True)),
            ],
        ),
    ]
Ejemplo n.º 4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.UUIDField(
                     default=uuid.uuid4,
                     editable=False,
                     primary_key=True,
                     serialize=False,
                 )),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text='Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status'
                 )),
                ('username',
                 models.CharField(
                     error_messages={'unique': 'A user with that username already exists.'},
                     help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[django.contrib.auth.validators.UnicodeUsernameValidator()],
                     verbose_name='username'
                 )),
                ('first_name',
                 models.CharField(
                     blank=True,
                     max_length=30,
                     verbose_name='first name'
                 )),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text='Designates whether the user can log into this admin site.',
                     verbose_name='staff status'
                 )),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text='Designates whether this user should be treated as active. '
                               'Unselect this instead of deleting accounts.',
                     verbose_name='active'
                 )),
                ('date_joined',
                 models.DateTimeField(
                     default=django.utils.timezone.now,
                     verbose_name='date joined'
                 )),
                ('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',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30)),
                ('is_income', models.BooleanField(default=False)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=30)),
                ('date', models.DateField(default=datetime.date.today)),
                ('amount',
                 apps.core.models.PositiveDecimalField(
                     decimal_places=2,
                     max_digits=7,
                 )),
                ('is_income', models.BooleanField()),
                ('category',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='core.Category'
                 )),
                ('user',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL
                 )),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='category',
            unique_together={('name', 'user')},
        ),
    ]
Ejemplo n.º 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')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('name', models.CharField(max_length=20)),
                ('birthday', models.DateField()),
                ('address', models.CharField(max_length=50)),
                ('contact_number', models.CharField(max_length=50)),
                ('deleted_at', models.DateTimeField(help_text='deleted date', null=True)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=15)),
                ('last_name', models.CharField(max_length=15)),
                ('email', models.EmailField(help_text='Email', max_length=30)),
                ('email_password', models.CharField(help_text='Email password', max_length=40)),
                ('skype', models.CharField(help_text='Skype username. It could be null.', max_length=30, null=True)),
                ('skype_password', models.CharField(help_text='Skype password. It could be null.', max_length=30, null=True)),
                ('status', models.BooleanField(default=True, help_text='It represents whether account is active or not.')),
                ('phone_number', models.CharField(help_text='Phone number related to this account.It could be null', max_length=11, null=True)),
                ('created_date', models.DateField(help_text='The date when the account is created.')),
                ('suspended_date', models.DateField(help_text='The date when the account is suspended.', null=True)),
                ('registered_date', models.DateTimeField(auto_now_add=True)),
                ('recital', models.TextField(help_text='May include zipcode, address and other information.', max_length=1000, null=True)),
                ('title', models.CharField(help_text='Title', max_length=150)),
                ('overview', models.TextField(help_text='Overview', max_length=5000)),
                ('deleted_at', models.DateTimeField(help_text='deleted date', null=True)),
                ('is_payment_account', models.BooleanField(default=False, help_text='Indicates whether it is payment gateway account or not')),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('year', models.IntegerField(help_text='booking year')),
                ('month', models.IntegerField(help_text='booking month')),
                ('status', models.CharField(choices=[('Calculated', 'Calculated'), ('Activate', 'Active')], help_text='active or calculated', max_length=20)),
                ('weeks', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), help_text='aggregation of week numbers for month', size=None)),
                ('booked_date', models.DateTimeField(help_text='date when accounting month is finished', null=True)),
                ('comments', models.TextField(help_text='comments', max_length=1024, null=True)),
                ('start_date', models.DateField(help_text='working month start date')),
                ('end_date', models.DateField(help_text='working month end date')),
                ('done_by', models.ForeignKey(help_text='user who calculated whole', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('code', models.CharField(max_length=2)),
            ],
        ),
        migrations.CreateModel(
            name='Earning',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cost', models.FloatField()),
                ('week_of_year', models.IntegerField()),
                ('year', models.IntegerField()),
                ('status', models.CharField(choices=[('Review', 'Review'), ('Withdraw', 'Withdraw')], default='Review', max_length=20)),
                ('withdrawn_date', models.DateField(help_text='date time when withdraw', null=True)),
                ('comments', models.TextField(help_text='description', max_length=1024, null=True)),
                ('created_at', models.DateField(auto_now_add=True, help_text='created date')),
                ('deleted_at', models.DateTimeField(help_text='deleted date', null=True)),
                ('approved_date', models.DateField(help_text='date when approved', null=True)),
                ('account', models.ForeignKey(help_text='mapped to account', null=True, on_delete=django.db.models.deletion.SET_NULL, to='tms.Account')),
                ('approved_by', models.ForeignKey(help_text='user who confirmed paying', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_by', to=settings.AUTH_USER_MODEL)),
                ('earned_by', models.ForeignKey(help_text='user who earns', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='earned_by', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('description', models.CharField(max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Site',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('url', models.URLField(max_length=100)),
                ('description', models.TextField(max_length=1024, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('description', models.CharField(max_length=100, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='account',
            name='country',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='tms.Country'),
        ),
        migrations.AddField(
            model_name='account',
            name='site',
            field=models.ForeignKey(help_text='Working site', null=True, on_delete=django.db.models.deletion.SET_NULL, to='tms.Site'),
        ),
        migrations.AddField(
            model_name='account',
            name='user',
            field=models.ForeignKey(help_text='Owner of account', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='role',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='tms.Role'),
        ),
        migrations.AddField(
            model_name='user',
            name='team',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='tms.Team'),
        ),
        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'),
        ),
    ]
Ejemplo n.º 6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
        ('areas', '0001_initial'),
    ]

    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')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('mobile', models.CharField(max_length=11,
                                            verbose_name='手机号码')),
                ('email_active',
                 models.BooleanField(default=False, verbose_name='邮箱验证状态')),
            ],
            options={
                'db_table': 'tb_users',
                'verbose_name_plural': '用户信息',
                'verbose_name': '用户信息',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateField(auto_now=True, verbose_name='更新时间')),
                ('title', models.CharField(max_length=20,
                                           verbose_name='地址名称')),
                ('receiver', models.CharField(max_length=20,
                                              verbose_name='收货人')),
                ('place', models.CharField(max_length=50, verbose_name='地址')),
                ('mobile', models.CharField(max_length=11, verbose_name='手机')),
                ('tel',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=20,
                                  null=True,
                                  verbose_name='固定电话')),
                ('email',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=30,
                                  null=True,
                                  verbose_name='电子邮箱')),
                ('is_deleted',
                 models.BooleanField(default=False, verbose_name='逻辑删除')),
                ('city',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='city_addresses',
                                   to='areas.Area',
                                   verbose_name='市')),
                ('district',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='district_addresses',
                                   to='areas.Area',
                                   verbose_name='区')),
                ('province',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='province_addresses',
                                   to='areas.Area',
                                   verbose_name='省')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='addresses',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='用户')),
            ],
            options={
                'db_table': 'tb_address',
                'verbose_name_plural': '用户地址',
                'verbose_name': '用户地址',
                'ordering': ['-update_time'],
            },
        ),
        migrations.AddField(
            model_name='user',
            name='default_address',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='users',
                to='users.Address',
                verbose_name='默认地址'),
        ),
        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'),
        ),
    ]
Ejemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Attendance',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('attendance_date', models.DateField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Courses',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='SessionYearModel',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('session_start_year', models.DateField()),
                ('session_end_year', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='CustomUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('user_type',
                 models.CharField(choices=[(1, 'HOD'), (2, 'Staff'),
                                           (3, 'Student')],
                                  default=1,
                                  max_length=10)),
                ('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',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Subjects',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('course_id',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='StdMgtApp.courses')),
                ('staff_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Students',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('address', models.TextField()),
                ('gender', models.CharField(max_length=255)),
                ('profile_pic', models.FileField(upload_to='')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('admin',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
                ('course_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.courses')),
                ('session_year_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='StdMgtApp.sessionyearmodel')),
            ],
        ),
        migrations.CreateModel(
            name='Staffs',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('address', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('admin',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='NotificationStudent',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('message', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('student_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.students')),
            ],
        ),
        migrations.CreateModel(
            name='NotificationStaffs',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('message', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('staff_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.staffs')),
            ],
        ),
        migrations.CreateModel(
            name='LeaveReportStudent',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('leave_date', models.CharField(max_length=255)),
                ('leave_message', models.TextField()),
                ('leave_status', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('student_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.students')),
            ],
        ),
        migrations.CreateModel(
            name='LeaveReportStaff',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('leave_date', models.CharField(max_length=255)),
                ('leave_message', models.TextField()),
                ('leave_status', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('staff_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.staffs')),
            ],
        ),
        migrations.CreateModel(
            name='FeedbackStudent',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('feedback', models.TextField()),
                ('feedback_reply', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('student_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.students')),
            ],
        ),
        migrations.CreateModel(
            name='FeedbackStaffs',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('feedback', models.TextField()),
                ('feedback_reply', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('staff_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.staffs')),
            ],
        ),
        migrations.CreateModel(
            name='AttendanceReport',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('status', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('attendance_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.attendance')),
                ('student_id',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='StdMgtApp.students')),
            ],
        ),
        migrations.AddField(
            model_name='attendance',
            name='session_year_id',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='StdMgtApp.sessionyearmodel'),
        ),
        migrations.AddField(
            model_name='attendance',
            name='subject_id',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='StdMgtApp.subjects'),
        ),
        migrations.CreateModel(
            name='AdminHoD',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('admin',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
        ('shipmanager', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='PersonalCV',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('call_name',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='称呼')),
                ('age',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='年龄')),
                ('gender',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='性别')),
                ('nation',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='民族')),
                ('tall',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='身高')),
                ('native',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='籍贯')),
                ('address',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='现地址')),
                ('graduate',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='毕业院校')),
                ('graduate_time',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='毕业时间')),
                ('major',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='专业')),
                ('certificate_level',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='证书等级')),
                ('work_age',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='工作时间')),
                ('present_duty',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='现职位')),
                ('language',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='外语')),
                ('special_skills',
                 models.CharField(max_length=2000,
                                  null=True,
                                  verbose_name='特殊技能')),
                ('duty',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='求职职位')),
                ('salary',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='月薪')),
                ('route_area',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='航线区域')),
                ('contract',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='合同年限')),
                ('recruitment_ship',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='招聘船型')),
                ('special_certificate',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='特殊证书')),
                ('post_time',
                 models.DateField(auto_now_add=True,
                                  max_length=200,
                                  null=True,
                                  verbose_name='发布时间')),
                ('tel',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='电话')),
                ('QQ',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='QQ')),
                ('experience',
                 models.TextField(max_length=200,
                                  null=True,
                                  verbose_name='工作经历')),
                ('introduction',
                 models.TextField(max_length=200,
                                  null=True,
                                  verbose_name='自我介绍')),
                ('time',
                 models.CharField(max_length=30,
                                  null=True,
                                  verbose_name='时间范围')),
            ],
            options={
                'ordering': ['-post_time'],
            },
        ),
        migrations.AlterModelOptions(
            name='library',
            options={'ordering': ['-post_time']},
        ),
        migrations.AlterModelOptions(
            name='user',
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users'
            },
        ),
        migrations.AlterModelManagers(
            name='user',
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.RemoveField(
            model_name='user',
            name='certificate_level',
        ),
        migrations.RemoveField(
            model_name='user',
            name='company_name',
        ),
        migrations.RemoveField(
            model_name='user',
            name='duty',
        ),
        migrations.RemoveField(
            model_name='user',
            name='duty_id',
        ),
        migrations.RemoveField(
            model_name='user',
            name='recruitment_ship',
        ),
        migrations.RemoveField(
            model_name='user',
            name='route_area',
        ),
        migrations.RemoveField(
            model_name='user',
            name='ship_age',
        ),
        migrations.RemoveField(
            model_name='user',
            name='special_certificate',
        ),
        migrations.RemoveField(
            model_name='user',
            name='time',
        ),
        migrations.RemoveField(
            model_name='user',
            name='tonnage',
        ),
        migrations.AddField(
            model_name='library',
            name='QQ',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='在线QQ'),
        ),
        migrations.AddField(
            model_name='library',
            name='address',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='公司地址'),
        ),
        migrations.AddField(
            model_name='library',
            name='contact',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='联系人'),
        ),
        migrations.AddField(
            model_name='library',
            name='contract',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='合同年限'),
        ),
        migrations.AddField(
            model_name='library',
            name='email',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='电子邮箱'),
        ),
        migrations.AddField(
            model_name='library',
            name='introduction',
            field=models.TextField(max_length=300,
                                   null=True,
                                   verbose_name='公司介绍'),
        ),
        migrations.AddField(
            model_name='library',
            name='onboard_location',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='上船地点'),
        ),
        migrations.AddField(
            model_name='library',
            name='onboard_time',
            field=models.CharField(max_length=200,
                                   null=True,
                                   verbose_name='上船时间'),
        ),
        migrations.AddField(
            model_name='library',
            name='post_time',
            field=models.DateField(auto_now=True,
                                   max_length=300,
                                   null=True,
                                   verbose_name='搜索时间'),
        ),
        migrations.AddField(
            model_name='library',
            name='property',
            field=models.CharField(max_length=200,
                                   null=True,
                                   verbose_name='公司性质'),
        ),
        migrations.AddField(
            model_name='library',
            name='require',
            field=models.TextField(max_length=300,
                                   null=True,
                                   verbose_name='具体要求'),
        ),
        migrations.AddField(
            model_name='library',
            name='salary',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='提供月薪'),
        ),
        migrations.AddField(
            model_name='library',
            name='tel',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='公司电话'),
        ),
        migrations.AddField(
            model_name='user',
            name='date_joined',
            field=models.DateTimeField(default=django.utils.timezone.now,
                                       verbose_name='date joined'),
        ),
        migrations.AddField(
            model_name='user',
            name='email',
            field=models.EmailField(blank=True,
                                    max_length=254,
                                    verbose_name='email address'),
        ),
        migrations.AddField(
            model_name='user',
            name='first_name',
            field=models.CharField(blank=True,
                                   max_length=30,
                                   verbose_name='first name'),
        ),
        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='is_active',
            field=models.BooleanField(
                default=True,
                help_text=
                'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                verbose_name='active'),
        ),
        migrations.AddField(
            model_name='user',
            name='is_staff',
            field=models.BooleanField(
                default=False,
                help_text=
                'Designates whether the user can log into this admin site.',
                verbose_name='staff status'),
        ),
        migrations.AddField(
            model_name='user',
            name='is_superuser',
            field=models.BooleanField(
                default=False,
                help_text=
                'Designates that this user has all permissions without explicitly assigning them.',
                verbose_name='superuser status'),
        ),
        migrations.AddField(
            model_name='user',
            name='last_login',
            field=models.DateTimeField(blank=True,
                                       null=True,
                                       verbose_name='last login'),
        ),
        migrations.AddField(
            model_name='user',
            name='last_name',
            field=models.CharField(blank=True,
                                   max_length=30,
                                   verbose_name='last name'),
        ),
        migrations.AddField(
            model_name='user',
            name='nickname',
            field=models.CharField(blank=True,
                                   max_length=50,
                                   verbose_name='昵称'),
        ),
        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'),
        ),
        migrations.AlterField(
            model_name='article',
            name='created_time',
            field=models.DateTimeField(auto_now_add=True,
                                       null=True,
                                       verbose_name='创建时间'),
        ),
        migrations.AlterField(
            model_name='article',
            name='last_modified_time',
            field=models.DateTimeField(auto_now_add=True, verbose_name='修改时间'),
        ),
        migrations.AlterField(
            model_name='article',
            name='status',
            field=models.CharField(max_length=1, verbose_name='文章状态'),
        ),
        migrations.AlterField(
            model_name='library',
            name='certificate_level',
            field=models.CharField(max_length=200,
                                   null=True,
                                   verbose_name='证书等级'),
        ),
        migrations.AlterField(
            model_name='library',
            name='duty',
            field=models.CharField(max_length=70, null=True),
        ),
        migrations.AlterField(
            model_name='library',
            name='recruitment_ship',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='招聘船型'),
        ),
        migrations.AlterField(
            model_name='library',
            name='route_area',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='路线区域'),
        ),
        migrations.AlterField(
            model_name='library',
            name='special_certificate',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='特殊证书'),
        ),
        migrations.AlterField(
            model_name='library',
            name='time',
            field=models.CharField(max_length=300,
                                   null=True,
                                   verbose_name='搜索时间'),
        ),
        migrations.AlterField(
            model_name='library',
            name='tonnage',
            field=models.CharField(max_length=200,
                                   null=True,
                                   verbose_name='吨位'),
        ),
        migrations.AlterField(
            model_name='user',
            name='password',
            field=models.CharField(max_length=128, verbose_name='password'),
        ),
        migrations.AlterField(
            model_name='user',
            name='username',
            field=models.CharField(
                error_messages={
                    'unique': 'A user with that username already exists.'
                },
                help_text=
                'Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.',
                max_length=30,
                unique=True,
                validators=[
                    django.core.validators.RegexValidator(
                        '^[\\w.@+-]+$',
                        'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.'
                    )
                ],
                verbose_name='username'),
        ),
    ]
Ejemplo n.º 9
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')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('is_student', models.BooleanField(default=False)),
                ('is_teacher', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Class',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('location', models.CharField(max_length=50)),
                ('time_day',
                 models.CharField(choices=[('MON', 'Monday'),
                                           ('TUE', 'Tuesday'),
                                           ('WED', 'Wednesday'),
                                           ('THU', 'Thursday'),
                                           ('FRI', 'Friday'),
                                           ('SAT', 'Saturday'),
                                           ('SUN', 'Sunday')],
                                  default='WED',
                                  max_length=3)),
                ('time_start',
                 models.TimeField(default=datetime.time(15, 30))),
                ('time_end', models.TimeField(default=datetime.time(16, 30))),
            ],
        ),
        migrations.CreateModel(
            name='MemberLevel',
            fields=[
                ('level_status',
                 models.CharField(choices=[('B', 'Bronze'), ('S', 'Silver'),
                                           ('G', 'Gold'), ('P', 'Platinum'),
                                           ('D', 'Diamond')],
                                  default='B',
                                  max_length=1,
                                  primary_key=True,
                                  serialize=False)),
                ('price', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Member',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('funds', models.FloatField(default=0)),
                ('expired_date',
                 models.DateField(default=datetime.date(2019, 5, 30))),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=254)),
                ('phone_number',
                 models.CharField(
                     blank=True,
                     max_length=17,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             "Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.",
                             regex='^\\+?1?\\d{9,15}$')
                     ])),
                ('classes', models.ManyToManyField(to='login.Class')),
                ('level',
                 models.ForeignKey(default='B',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='login.MemberLevel')),
            ],
        ),
        migrations.CreateModel(
            name='Staff',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        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'),
        ),
        migrations.AddField(
            model_name='class',
            name='staff',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='login.Staff'),
        ),
    ]
Ejemplo n.º 10
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')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('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')),
                ('created',
                 models.DateTimeField(
                     auto_now_add=True,
                     help_text='Date time on which the object was created.',
                     verbose_name='created at')),
                ('modified',
                 models.DateTimeField(
                     auto_now=True,
                     help_text=
                     'Date time on which the object was last modified.',
                     verbose_name='modified at')),
                ('email',
                 models.EmailField(error_messages={
                     'unique':
                     'A user with that email already exists.'
                 },
                                   max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('dni',
                 models.CharField(error_messages={
                     'unique':
                     'A user with is dni already exists.'
                 },
                                  max_length=8,
                                  unique=True,
                                  verbose_name='documento de identidad')),
                ('birthdate',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='fecha de nacimiento')),
                ('is_client',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'help esasy to distinguish users and perfom querys')),
                ('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={
                'ordering': ['-created', '-modified'],
                'get_latest_by': 'created',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
Ejemplo n.º 11
0
class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
        ('study', '0002_auto_20190709_1801'),
    ]

    operations = [
        migrations.CreateModel(
            name='ApplicationForm',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='CourseSession',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('started_at', models.DateField()),
                ('status',
                 models.CharField(choices=[('planned', 'Planned'),
                                           ('in_progress', 'In progress'),
                                           ('finished', 'Finished'),
                                           ('cancelled', 'Cancelled')],
                                  max_length=11)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='study.Course')),
            ],
        ),
        migrations.CreateModel(
            name='Participant',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('role',
                 models.CharField(choices=[('student', 'Student'),
                                           ('trainer', 'Trainer'),
                                           ('expert', 'Expert'),
                                           ('admin', 'Admin')],
                                  max_length=7)),
                ('status',
                 models.CharField(choices=[('possible', 'Possible'),
                                           ('active', 'Active'),
                                           ('lost', 'Lost')],
                                  max_length=8)),
                ('score', models.IntegerField()),
                ('course_session',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='study.CourseSession')),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('country', models.CharField(max_length=100)),
                ('city', models.CharField(max_length=100)),
                ('language',
                 models.CharField(choices=[('ru', 'Russian'),
                                           ('en', 'English'),
                                           ('ua', 'Ukrainian')],
                                  max_length=2)),
                ('skype', models.CharField(max_length=100)),
                ('google_account', models.CharField(max_length=100)),
                ('github_account', models.CharField(max_length=100)),
                ('phone', models.CharField(max_length=20)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AlterField(
            model_name='author',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='study.UserProfile'),
        ),
        migrations.DeleteModel(name='Profile', ),
        migrations.AddField(
            model_name='participant',
            name='user_profile',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='study.UserProfile'),
        ),
        migrations.AddField(
            model_name='applicationform',
            name='course_session',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='study.CourseSession'),
        ),
        migrations.AddField(
            model_name='applicationform',
            name='user_profile',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.PROTECT,
                to='study.UserProfile'),
        ),
        migrations.AlterUniqueTogether(
            name='participant',
            unique_together={('course_session', 'user_profile', 'role')},
        ),
    ]
Ejemplo n.º 12
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Materia',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('creacion', models.DateTimeField(auto_now_add=True)),
                ('ultima_actualizacion', models.DateTimeField(auto_now=True)),
                ('archivado', models.BooleanField(default=False)),
                ('nombre', models.CharField(max_length=100, unique=True)),
                ('descripcion', models.TextField()),
            ],
            options={
                'verbose_name': 'Materia',
                'verbose_name_plural': 'Materias',
            },
        ),
        migrations.CreateModel(
            name='MateriaUsuario',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('creacion', models.DateTimeField(auto_now_add=True)),
                ('ultima_actualizacion', models.DateTimeField(auto_now=True)),
                ('archivado', models.BooleanField(default=False)),
                ('precio',
                 models.PositiveIntegerField(verbose_name='Precio por hora')),
                ('materia',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Materia')),
            ],
            options={
                'verbose_name': 'Materia Usuario',
                'verbose_name_plural': 'Materias Usuarios',
            },
        ),
        migrations.CreateModel(
            name='Solicitud',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('creacion', models.DateTimeField(auto_now_add=True)),
                ('ultima_actualizacion', models.DateTimeField(auto_now=True)),
                ('archivado', models.BooleanField(default=False)),
                ('descripcion', models.TextField()),
                ('calificacion',
                 models.PositiveIntegerField(
                     blank=True,
                     null=True,
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(5)
                     ])),
                ('comentario', models.TextField()),
                ('fecha', models.DateField()),
                ('hora_inicial', models.TimeField()),
                ('hora_final', models.TimeField()),
                ('aprobada', models.BooleanField(default=False)),
                ('finalizada', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'Solicitud',
                'verbose_name_plural': 'Solicitudes',
            },
        ),
        migrations.CreateModel(
            name='TematicaMateria',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('creacion', models.DateTimeField(auto_now_add=True)),
                ('ultima_actualizacion', models.DateTimeField(auto_now=True)),
                ('archivado', models.BooleanField(default=False)),
                ('descripcion', models.TextField()),
                ('materia',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Materia')),
            ],
            options={
                'verbose_name': 'Tematica Materia',
                'verbose_name_plural': 'Tematicas Materias',
            },
        ),
        migrations.CreateModel(
            name='Usuario',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('creacion', models.DateTimeField(auto_now_add=True)),
                ('ultima_actualizacion', models.DateTimeField(auto_now=True)),
                ('archivado', models.BooleanField(default=False)),
                ('descripcion', models.TextField()),
                ('telefono', models.CharField(max_length=10, unique=True)),
                ('direccion', models.CharField(max_length=50)),
            ],
            options={
                'verbose_name': 'Usuario',
                'verbose_name_plural': 'Usuarios',
            },
            bases=('auth.user', models.Model),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='solicitud',
            name='interesado',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='+',
                to='app.Usuario'),
        ),
        migrations.AddField(
            model_name='solicitud',
            name='materia',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.Materia'),
        ),
        migrations.AddField(
            model_name='solicitud',
            name='tematica',
            field=smart_selects.db_fields.ChainedForeignKey(
                chained_field='materia',
                chained_model_field='materia',
                on_delete=django.db.models.deletion.CASCADE,
                to='app.TematicaMateria'),
        ),
        migrations.AddField(
            model_name='solicitud',
            name='tutor',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='+',
                to='app.Usuario'),
        ),
        migrations.AddField(
            model_name='materiausuario',
            name='usuario',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.Usuario'),
        ),
        migrations.AlterUniqueTogether(
            name='materiausuario',
            unique_together=set([('materia', 'usuario')]),
        ),
    ]
Ejemplo n.º 13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_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')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('phone', models.BigIntegerField(null=True)),
                ('avatar', models.FileField(default='avatar/default.png', upload_to='avatar/')),
                ('create_time', models.DateField(auto_now_add=True)),
            ],
            options={
                'verbose_name_plural': '用户表',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=64)),
                ('desc', models.CharField(max_length=255)),
                ('content', models.TextField()),
                ('create_time', models.DateField(auto_now_add=True)),
                ('comment_num', models.BigIntegerField(default=0)),
                ('up_num', models.BigIntegerField(default=0)),
                ('down_num', models.BigIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Article2Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app01.Article')),
            ],
        ),
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('site_name', models.CharField(max_length=32)),
                ('site_title', models.CharField(max_length=64)),
                ('site_theme', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('blog', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app01.Blog')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=255)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app01.Article')),
                ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app01.Comment')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('blog', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app01.Blog')),
            ],
        ),
        migrations.CreateModel(
            name='UpAndDown',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_up', models.BooleanField()),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app01.Article')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='article2tag',
            name='tag',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app01.Tag'),
        ),
        migrations.AddField(
            model_name='article',
            name='blog',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app01.Blog'),
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app01.Category'),
        ),
        migrations.AddField(
            model_name='article',
            name='tags',
            field=models.ManyToManyField(through='app01.Article2Tag', to='app01.Tag'),
        ),
        migrations.AddField(
            model_name='user',
            name='blog',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='app01.Blog'),
        ),
        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'),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0015_user_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='注册时间')),
                ('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': '用户信息',
                'verbose_name_plural': '用户信息',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ResumeData',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=40, verbose_name='姓名')),
                ('gender',
                 models.CharField(choices=[('male', '男'), ('female', '女')],
                                  max_length=6,
                                  verbose_name='性别')),
                ('email', models.EmailField(max_length=50, verbose_name='邮箱')),
                ('phone', models.CharField(max_length=30, verbose_name='手机')),
                ('birthday', models.CharField(max_length=30,
                                              verbose_name='生日')),
                ('city', models.CharField(max_length=40, verbose_name='城市')),
                ('website', models.URLField(max_length=40,
                                            verbose_name='个人主页')),
                ('school', models.CharField(max_length=40, verbose_name='学校')),
                ('major', models.CharField(max_length=40, verbose_name='专业')),
                ('skill', models.TextField(verbose_name='技能信息')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='用户')),
            ],
            options={
                'verbose_name': '简历信息',
                'verbose_name_plural': '简历信息',
            },
        ),
        migrations.CreateModel(
            name='EduInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('school_1', models.CharField(max_length=40,
                                              verbose_name='学校')),
                ('start_time_1', models.DateField(verbose_name='入学时间')),
                ('end_time_1', models.DateField(verbose_name='毕业时间')),
                ('school_2',
                 models.CharField(max_length=40, null=True,
                                  verbose_name='学校')),
                ('start_time_2',
                 models.DateField(null=True, verbose_name='入学时间')),
                ('end_time_2', models.DateField(null=True,
                                                verbose_name='毕业时间')),
                ('school_3',
                 models.CharField(max_length=40, null=True,
                                  verbose_name='学校')),
                ('start_time_3',
                 models.DateField(null=True, verbose_name='入学时间')),
                ('end_time_3', models.DateField(null=True,
                                                verbose_name='毕业时间')),
                ('resume',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='users.ResumeData',
                                   verbose_name='简历')),
            ],
            options={
                'verbose_name': '教育经历',
                'verbose_name_plural': '教育经历',
            },
        ),
    ]
Ejemplo n.º 15
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=30,
                     unique=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             '^[\\w.@+-]+$',
                             'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.'
                         )
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('registered', models.BooleanField(default=False)),
                ('registration_code', models.UUIDField(default=uuid.uuid4)),
                ('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_plural': 'users',
                'abstract': False,
                'verbose_name': 'user',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(blank=True, max_length=100)),
                ('subtitle', models.CharField(blank=True, max_length=100)),
                ('study_task_identifier',
                 models.CharField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='ActivityAnswer',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('question_identifier',
                 models.CharField(blank=True, max_length=100)),
                ('value', models.CharField(blank=True, max_length=1000)),
                ('activity',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='activity_answers',
                                   to='api.Activity')),
                ('user',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='activity_answers',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ActivityStatus',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('complete', models.BooleanField(default=False)),
                ('activity',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='activity_statuses',
                                   to='api.Activity')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='activity_statuses',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Condition',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(blank=True, max_length=100)),
                ('overview', models.CharField(blank=True, max_length=1024)),
                ('description', models.CharField(blank=True, max_length=1024)),
            ],
        ),
        migrations.CreateModel(
            name='ConsentPDF',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('consent_pdf',
                 models.
                 FileField(storage=django.core.files.storage.FileSystemStorage(
                     base_url='/data/consent/',
                     location=
                     '/Users/ifoundit/Dropbox/Scripps/projects/gene-pc/gene-pc-api/data/consent'
                 ),
                           upload_to='')),
                ('name', models.CharField(blank=True, max_length=100)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='consent_pdfs',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Population',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='RiskScore',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(blank=True, max_length=100)),
                ('value',
                 models.FloatField(blank=True, default=-1.0, max_length=100)),
                ('description', models.CharField(blank=True, max_length=1024)),
                ('calculated', models.BooleanField(default=False)),
                ('featured', models.BooleanField(default=False)),
                ('condition',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='risk_scores',
                                   to='api.Condition')),
                ('population',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='risk_scores',
                                   to='api.Population')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='risk_scores',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Signature',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('consent_signed', models.BooleanField(default=False)),
                ('date_signed', models.DateField()),
                ('consent_pdf',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='api.ConsentPDF')),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='riskscore',
            unique_together=set([('user', 'condition', 'population')]),
        ),
        migrations.AlterUniqueTogether(
            name='activitystatus',
            unique_together=set([('user', 'activity')]),
        ),
    ]
Ejemplo n.º 16
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='checkcode',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email', models.EmailField(max_length=100)),
                ('phone', models.CharField(max_length=20)),
                ('code', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='idsinbloodinfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ids', models.CharField(max_length=20, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='patient',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='auth.user')),
                ('phone', models.CharField(max_length=20, null=True)),
                ('name', models.CharField(max_length=20, null=True)),
                ('birthday', models.DateField(null=True)),
                ('height', models.CharField(max_length=20, null=True)),
                ('gender', models.BooleanField(max_length=10, null=True)),
                ('fcm_id', models.CharField(max_length=10, null=True)),
                ('address', models.CharField(max_length=100, null=True)),
                ('weight', models.CharField(max_length=20, null=True)),
                ('status', models.CharField(default='normal', max_length=20)),
                ('group', models.CharField(max_length=20, null=True)),
                ('unread_records1', models.CharField(max_length=20,
                                                     null=True)),
                ('unread_records2', models.CharField(max_length=20,
                                                     null=True)),
                ('unread_records3', models.CharField(max_length=20,
                                                     null=True)),
                ('email_verfied',
                 models.BooleanField(default=False, max_length=10, null=True)),
                ('privacy_policy',
                 models.BooleanField(default=True, max_length=10, null=True)),
                ('must_change_password',
                 models.BooleanField(default=False, max_length=10)),
                ('badge', models.CharField(max_length=20, null=True)),
                ('login_times', models.CharField(default=0, max_length=100)),
                ('created_at',
                 models.DateTimeField(auto_now_add=True, null=True)),
                ('update_at', models.DateTimeField(auto_now=True, null=True)),
                ('after_recording', models.CharField(max_length=20,
                                                     null=True)),
                ('no_recording_for_a_day',
                 models.CharField(max_length=20, null=True)),
                ('over_max_or_under_min',
                 models.CharField(max_length=20, null=True)),
                ('after_meal', models.CharField(max_length=20, null=True)),
                ('unit_of_sugar', models.CharField(max_length=20, null=True)),
                ('unit_of_weight', models.CharField(max_length=20, null=True)),
                ('unit_of_height', models.CharField(max_length=20, null=True)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='sugarinfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sugar_delta_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_delta_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_morning_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_morning_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_evening_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_evening_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_before_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_before_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_after_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('sugar_after_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('systolic_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('systolic_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('diastolic_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('diastolic_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('pulse_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('pulse_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('weight_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('weight_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('bmi_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('bmi_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('body_fat_max',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('body_fat_min',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('patient',
                 models.OneToOneField(
                     default=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='Denru.patient')),
            ],
        ),
        migrations.CreateModel(
            name='bloodinfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('a1c',
                 models.DecimalField(decimal_places=5,
                                     default=0,
                                     max_digits=20)),
                ('recorded_at', models.DateTimeField(null=True)),
                ('created_at',
                 models.DateTimeField(auto_now_add=True, null=True)),
                ('update_at', models.DateTimeField(auto_now=True, null=True)),
                ('patient',
                 models.ForeignKey(default=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='Denru.patient')),
            ],
        ),
    ]
Ejemplo n.º 17
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')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('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')),
                ('is_student', models.BooleanField(default=False)),
                ('is_lecturer', models.BooleanField(default=False)),
                ('phone', models.CharField(blank=True, max_length=60, null=True)),
                ('address', models.CharField(blank=True, max_length=60, null=True)),
                ('picture', models.ImageField(blank=True, null=True, upload_to='pictures/')),
                ('email', models.EmailField(blank=True, max_length=254, null=True)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('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',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('courseTitle', models.CharField(max_length=200)),
                ('courseCode', models.CharField(max_length=200, unique=True)),
                ('courseUnit', models.CharField(max_length=200)),
                ('description', models.TextField(blank=True, max_length=200)),
                ('level', models.CharField(blank=True, choices=[('100', 100), ('200', 200), ('300', 300), ('400', 400), ('500', 500)], max_length=3)),
                ('semester', models.CharField(choices=[('First', 'First'), ('Second', 'Second')], max_length=200)),
                ('is_elective', models.BooleanField(blank=True, default=False, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Session',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('session', models.CharField(max_length=200, unique=True)),
                ('is_current_session', models.BooleanField(blank=True, default=False, null=True)),
                ('next_session_begins', models.DateField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('id_number', models.CharField(max_length=20, unique=True)),
                ('level', models.CharField(choices=[('100', 100), ('200', 200), ('300', 300), ('400', 400), ('500', 500)], max_length=3)),
                ('faculty', models.CharField(choices=[('FOS', 'FOS'), ('FOE', 'FOE'), ('FBMS', 'FBMS'), ('FBSS', 'FBSS'), ('FOA', 'FOA'), ('FOL', 'FOL')], max_length=4)),
                ('department', models.CharField(choices=[('COMPUTER SCIENCE', 'COMPUTER SCIENCE'), ('MATHEMATICS', 'MATHEMATICS'), ('PHYSICS', 'PHYSICS'), ('CHEMISTRY', 'CHEMISTRY'), ('BIOLOGICAL SCIENCE', 'BIOLOGICAL SCIENCE'), ('INDUSTRIAL CHEMISTRY', 'INDUSTRIAL CHEMISTRY'), ('MICROBIOLOGY', 'MICROBIOLOGY'), ('BIOCHEMISTRY', 'BIOCHEMISTRY'), ('COMPUTER INFORMATION SYSTEM', 'COMPUTER INFORMATION SYSTEM'), ('AGRICULTURAL ENGINEERING', 'AGRICULTURAL ENGINEERING'), ('CIVIL ENGINEERING', 'CIVIL ENGINEERING'), ('ELECTRONIC & ELECTRICAL ENGINEERING', 'ELECTRONIC & ELECTRICAL ENGINEERING'), ('MECHANICAL ENGINEERING', 'MECHANICAL ENGINEERING'), ('ACCOUNTING', 'ACCOUNTING'), ('BUSINESS ADMINISTRATION', 'BUSINESS ADMINISTRATION'), ('ECONOMICS', 'ECONOMICS'), ('MASS COMMUNICATION', 'MASS COMMUNICATION'), ('POLITICAL SCIENCE', 'POLITICAL SCIENCE'), ('PUBLIC ADMINISTRATION', 'PUBLIC ADMINISTRATION'), ('LIBRARY INFORMATION SCIENCE', 'LIBRARY INFORMATION SCIENCE'), ('ANATOMY', 'ANATOMY'), ('NURSING', 'NURSING'), ('PUBLIC HEALTH', 'PUBLIC HEALTH'), ('PHYSIOLOGY', 'PHYSIOLOGY'), ('RELIGIOUS STUDIES', 'RELIGIOUS STUDIES'), ('HISTORY & INTERNATIONAL STUDIES', 'HISTORY & INTERNATIONAL STUDIES'), ('LANGUAGE & LITERARY STUDIES', 'LANGUAGE & LITERARY STUDIES'), ('LAW', 'LAW')], max_length=40)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TakenCourse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ca', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('exam', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('total', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('grade', models.CharField(blank=True, choices=[('A', 'A'), ('B', 'B'), ('C', 'C'), ('D', 'D'), ('F', 'F')], max_length=1)),
                ('comment', models.CharField(blank=True, choices=[('PASS', 'PASS'), ('FAIL', 'FAIL')], max_length=200)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='taken_courses', to='portal.Course')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='portal.Student')),
            ],
        ),
        migrations.CreateModel(
            name='Semester',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('semester', models.CharField(blank=True, choices=[('First', 'First'), ('Second', 'Second')], max_length=10)),
                ('is_current_semester', models.BooleanField(blank=True, default=False, null=True)),
                ('next_semester_begins', models.DateField(blank=True, null=True)),
                ('session', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='portal.Session')),
            ],
        ),
        migrations.CreateModel(
            name='Result',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gpa', models.FloatField(null=True)),
                ('cgpa', models.FloatField(null=True)),
                ('semester', models.CharField(choices=[('First', 'First'), ('Second', 'Second')], max_length=100)),
                ('session', models.CharField(blank=True, max_length=100, null=True)),
                ('level', models.CharField(choices=[('100', 100), ('200', 200), ('300', 300), ('400', 400), ('500', 500)], max_length=100)),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='portal.Student')),
            ],
        ),
        migrations.CreateModel(
            name='RepeatingStudent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('level', models.CharField(choices=[('100', 100), ('200', 200), ('300', 300), ('400', 400), ('500', 500)], max_length=100)),
                ('session', models.CharField(blank=True, max_length=100, null=True)),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='portal.Student')),
            ],
        ),
        migrations.CreateModel(
            name='CourseAllocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('courses', models.ManyToManyField(related_name='allocated_course', to='portal.Course')),
                ('lecturer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('session', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='portal.Session')),
            ],
        ),
        migrations.CreateModel(
            name='CarryOverStudent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('semester', models.CharField(blank=True, choices=[('First', 'First'), ('Second', 'Second')], max_length=100, null=True)),
                ('session', models.CharField(blank=True, max_length=100, null=True)),
                ('level', models.CharField(blank=True, choices=[('100', 100), ('200', 200), ('300', 300), ('400', 400), ('500', 500)], max_length=10, null=True)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='portal.Course')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='portal.Student')),
            ],
        ),
    ]
Ejemplo n.º 18
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('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')),
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('pet_name',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='昵称')),
                ('phone',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='手机号')),
                ('email',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='邮箱')),
                ('avatar',
                 models.FileField(default='avatars/default.png',
                                  upload_to='avatars/')),
                ('brithday', models.DateField(null=True, verbose_name='生日')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('experience', models.IntegerField(default=0)),
                ('level', models.IntegerField(default=0)),
                ('gold', models.IntegerField(default=20)),
                ('area',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='地区')),
                ('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',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=50,
                                           verbose_name='文章标题')),
                ('abstract',
                 models.CharField(max_length=200, verbose_name='文章摘要')),
                ('desc', models.CharField(max_length=10000,
                                          verbose_name='文章描述')),
                ('group_cover',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='封面图')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('content', models.TextField()),
                ('comment_count', models.IntegerField(default=0)),
                ('up_count', models.IntegerField(default=0)),
                ('down_count', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=32,
                                           verbose_name='分类标题')),
            ],
        ),
        migrations.CreateModel(
            name='Profession',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('profession',
                 models.CharField(max_length=32, verbose_name='行业')),
            ],
            options={
                'db_table': 'wechat_wechat_profession',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=32,
                                           verbose_name='标签名称')),
            ],
        ),
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('profession',
                 models.CharField(max_length=32, verbose_name='标题')),
            ],
            options={
                'db_table': 'wechat_wechat_topic',
            },
        ),
        migrations.CreateModel(
            name='WechatGroup',
            fields=[
                ('profession',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='行业')),
                ('area',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='地区')),
                ('nik_name',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='名称')),
                ('tag',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='标签')),
                ('phone',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人电话')),
                ('qq',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人qq号')),
                ('avatars',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='头像')),
                ('qrc',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群二维码')),
                ('introduce',
                 models.CharField(max_length=10000,
                                  null=True,
                                  verbose_name='介绍')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('type',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='类别(微信红包,普通)')),
                ('master_wechat_account',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群主微信号')),
                ('link',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人')),
                ('stataus',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='状态')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='作者')),
            ],
            options={
                'db_table': 'wechat_wechatgroup',
            },
        ),
        migrations.CreateModel(
            name='Stroy',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=50, verbose_name='标题')),
                ('desc', models.CharField(max_length=1000, verbose_name='内容')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='作者')),
            ],
            options={
                'db_table': 'wechat_story',
            },
        ),
        migrations.CreateModel(
            name='SellWechatGroup',
            fields=[
                ('profession',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='行业')),
                ('area',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='地区')),
                ('nik_name',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='名称')),
                ('tag',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='标签')),
                ('phone',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人电话')),
                ('qq',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人qq号')),
                ('avatars',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='头像')),
                ('qrc',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群二维码')),
                ('introduce',
                 models.CharField(max_length=10000,
                                  null=True,
                                  verbose_name='介绍')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('p_count',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='人数')),
                ('price',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='价格')),
                ('master_wechat_account',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群主微信号')),
                ('group_cover',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群封面')),
                ('master_wechat_qrc',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群主微信二维码')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='作者')),
            ],
            options={
                'db_table': 'wechat_sellwechatgroup',
            },
        ),
        migrations.CreateModel(
            name='SelfWechat',
            fields=[
                ('profession',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='行业')),
                ('area',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='地区')),
                ('nik_name',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='名称')),
                ('tag',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='标签')),
                ('phone',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人电话')),
                ('qq',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人qq号')),
                ('avatars',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='头像')),
                ('qrc',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群二维码')),
                ('introduce',
                 models.CharField(max_length=10000,
                                  null=True,
                                  verbose_name='介绍')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('brithday',
                 models.DateField(auto_now_add=True, verbose_name='生日')),
                ('wechat',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='卖点介绍')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='作者')),
            ],
            options={
                'db_table': 'wechat_selfwechat',
            },
        ),
        migrations.CreateModel(
            name='PublicWechat',
            fields=[
                ('profession',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='行业')),
                ('area',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='地区')),
                ('nik_name',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='名称')),
                ('tag',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='标签')),
                ('phone',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人电话')),
                ('qq',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='联系人qq号')),
                ('avatars',
                 models.CharField(max_length=200, null=True,
                                  verbose_name='头像')),
                ('qrc',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群二维码')),
                ('introduce',
                 models.CharField(max_length=10000,
                                  null=True,
                                  verbose_name='介绍')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('wehcat_id',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='公众号id')),
                ('group_cover',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='群封面')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='作者')),
            ],
            options={
                'db_table': 'wechat_publicwechat',
            },
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=50, verbose_name='图片名')),
                ('desc', models.CharField(max_length=255,
                                          verbose_name='图片描述')),
                ('type', models.CharField(max_length=50, verbose_name='分类')),
                ('src', models.CharField(max_length=50, verbose_name='路径')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='作者')),
            ],
            options={
                'db_table': 'wechat_image',
            },
        ),
        migrations.CreateModel(
            name='Article2Tag',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('article',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='wechat.Article',
                                   verbose_name='文章')),
                ('tag',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='wechat.Tag',
                                   verbose_name='标签')),
            ],
            options={
                'unique_together': {('article', 'tag')},
            },
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='wechat.Category'),
        ),
        migrations.AddField(
            model_name='article',
            name='tags',
            field=models.ManyToManyField(through='wechat.Article2Tag',
                                         to='wechat.Tag'),
        ),
        migrations.AddField(
            model_name='article',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='作者'),
        ),
        migrations.CreateModel(
            name='Advert',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=50,
                                           verbose_name='品牌标题')),
                ('goodness',
                 models.CharField(max_length=500, verbose_name='品牌优势')),
                ('desc', models.CharField(max_length=500,
                                          verbose_name='品牌描述')),
                ('qrc', models.CharField(max_length=500,
                                         verbose_name='微信号二维码')),
                ('wechat', models.CharField(max_length=500,
                                            verbose_name='微信号')),
                ('link', models.CharField(max_length=500, verbose_name='联系人')),
                ('phone', models.CharField(max_length=500, verbose_name='电话')),
                ('qq', models.CharField(max_length=500, verbose_name='qq')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='作者')),
            ],
            options={
                'db_table': 'wechat_advert',
            },
        ),
    ]
Ejemplo n.º 19
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('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')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('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')),
                ('id_field',
                 models.AutoField(db_column='id_',
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('username', models.CharField(max_length=64, unique=True)),
                ('email', models.CharField(max_length=120)),
                ('password', models.CharField(max_length=200)),
                ('role', models.IntegerField(null=True)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('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={
                'db_table': 'user',
                'managed': True,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Class',
            fields=[
                ('id_field',
                 models.AutoField(db_column='id_',
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   unique=True)),
            ],
            options={
                'db_table': 'class',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id_field',
                 models.AutoField(db_column='id_',
                                  primary_key=True,
                                  serialize=False)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('amount', models.DecimalField(decimal_places=2,
                                               max_digits=6)),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField()),
                ('image', models.ImageField(upload_to='images')),
                ('class_field',
                 models.ForeignKey(db_column='class_id',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='skarbnik.Class')),
            ],
            options={
                'db_table': 'payment',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='PaymentDetail',
            fields=[
                ('id_field',
                 models.AutoField(db_column='id_',
                                  primary_key=True,
                                  serialize=False)),
                ('amount_paid',
                 models.DecimalField(decimal_places=2, max_digits=6)),
                ('payment',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='skarbnik.Payment')),
            ],
            options={
                'db_table': 'payment_detail',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id_field',
                 models.AutoField(db_column='id_',
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('class_field',
                 models.ForeignKey(blank=True,
                                   db_column='class_id',
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='skarbnik.Class')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'student',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='UserLoginActivity',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('login_IP', models.GenericIPAddressField(blank=True,
                                                          null=True)),
                ('login_datetime', models.DateTimeField(auto_now=True)),
                ('login_username',
                 models.CharField(blank=True, max_length=40, null=True)),
                ('status',
                 models.CharField(blank=True,
                                  choices=[('S', 'Success'), ('F', 'Failed')],
                                  default='S',
                                  max_length=1,
                                  null=True)),
                ('user_agent_info', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'user_login_activity',
                'verbose_name_plural': 'user_login_activities',
            },
        ),
        migrations.AddField(
            model_name='paymentdetail',
            name='student',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='skarbnik.Student'),
        ),
    ]
Ejemplo n.º 20
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                (
                    'last_login',
                    models.DateTimeField(blank=True,
                                         null=True,
                                         verbose_name='last login'),
                ),
                (
                    'is_superuser',
                    models.BooleanField(
                        default=False,
                        help_text=(
                            'Designates that this user has all permissions '
                            'without explicitly assigning them.'),
                        verbose_name='superuser status',
                    ),
                ),
                (
                    'username',
                    models.CharField(
                        error_messages={
                            'unique':
                            'A user with that username already exists.'
                        },
                        help_text=('Required. 150 characters or fewer. '
                                   'Letters, digits and @/./+/-/_ only.'),
                        max_length=150,
                        unique=True,
                        validators=[
                            django.contrib.auth.validators.
                            UnicodeUsernameValidator()
                        ],
                        verbose_name='username',
                    ),
                ),
                (
                    'first_name',
                    models.CharField(blank=True,
                                     max_length=150,
                                     verbose_name='first name'),
                ),
                (
                    'last_name',
                    models.CharField(blank=True,
                                     max_length=150,
                                     verbose_name='last 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'),
                ),
                (
                    'id',
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    'email',
                    models.EmailField(
                        blank=True,
                        max_length=254,
                        null=True,
                        unique=True,
                        verbose_name='email address',
                    ),
                ),
                ('bio', models.TextField(blank=True, verbose_name='bio')),
                ('url', models.URLField(blank=True, verbose_name='URL')),
                (
                    'company',
                    models.CharField(blank=True,
                                     max_length=30,
                                     verbose_name='company'),
                ),
                (
                    'location',
                    models.CharField(blank=True,
                                     max_length=256,
                                     verbose_name='location'),
                ),
                (
                    'phone_number',
                    phonenumber_field.modelfields.PhoneNumberField(
                        blank=True,
                        max_length=128,
                        null=True,
                        region=None,
                        unique=True,
                        verbose_name='phone number',
                    ),
                ),
                (
                    'social_security_number',
                    models.CharField(
                        blank=True,
                        max_length=11,
                        null=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                '^\\d\\d\\d-\\d\\d-\\d\\d\\d\\d$')
                        ],
                    ),
                ),
                (
                    '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',
                    ),
                ),
                (
                    'birth_date',
                    models.DateField(blank=True,
                                     null=True,
                                     verbose_name='birth date'),
                ),
                (
                    'language',
                    models.CharField(
                        choices=settings.LANGUAGES,
                        default=settings.LANGUAGE_CODE,
                        max_length=8,
                    ),
                ),
                (
                    'notes',
                    models.TextField(
                        blank=True,
                        help_text='notes for internal usage',
                        verbose_name='notes',
                    ),
                ),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
                'index_together': {('id', 'email')},
            },
            managers=[
                ('objects', openwisp_users.base.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Organization',
            fields=[
                (
                    'name',
                    models.CharField(help_text='The name of the organization',
                                     max_length=200),
                ),
                ('is_active', models.BooleanField(default=True)),
                (
                    'created',
                    organizations.fields.AutoCreatedField(
                        default=django.utils.timezone.now, editable=False),
                ),
                (
                    'modified',
                    organizations.fields.AutoLastModifiedField(
                        default=django.utils.timezone.now, editable=False),
                ),
                (
                    'slug',
                    organizations.fields.SlugField(
                        blank=True,
                        editable=False,
                        help_text=('The name in all lowercase, suitable for '
                                   'URL identification'),
                        max_length=200,
                        populate_from='name',
                        unique=True,
                    ),
                ),
                (
                    'id',
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    'description',
                    models.TextField(blank=True, verbose_name='description'),
                ),
                (
                    'email',
                    models.EmailField(blank=True,
                                      max_length=254,
                                      verbose_name='email'),
                ),
                ('url', models.URLField(blank=True, verbose_name='URL')),
            ],
            options={
                'abstract': False,
            },
            bases=(organizations.base.UnicodeMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Group',
            fields=[],
            options={
                'verbose_name': 'group',
                'verbose_name_plural': 'groups',
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=(openwisp_users.base.models.BaseGroup, 'auth.group'),
            managers=[
                ('objects', django.contrib.auth.models.GroupManager()),
            ],
        ),
        migrations.CreateModel(
            name='OrganizationUser',
            fields=[
                (
                    'created',
                    organizations.fields.AutoCreatedField(
                        default=django.utils.timezone.now, editable=False),
                ),
                (
                    'modified',
                    organizations.fields.AutoLastModifiedField(
                        default=django.utils.timezone.now, editable=False),
                ),
                ('is_admin', models.BooleanField(default=False)),
                (
                    'id',
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    'organization',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='organization_users',
                        to='sample_users.organization',
                    ),
                ),
                (
                    'user',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='sample_users_organizationuser',
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                'abstract': False,
                'ordering': ['organization', 'user'],
                'verbose_name': 'organization user',
                'verbose_name_plural': 'organization users',
                'unique_together': {('user', 'organization')},
            },
            bases=(organizations.base.UnicodeMixin, models.Model),
        ),
        migrations.AddField(
            model_name='organization',
            name='users',
            field=models.ManyToManyField(
                related_name='sample_users_organization',
                through='sample_users.OrganizationUser',
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterModelOptions(
            name='organization',
            options={
                'ordering': ['name'],
                'verbose_name': 'organization',
                'verbose_name_plural': 'organizations',
            },
        ),
        migrations.CreateModel(
            name='OrganizationOwner',
            fields=[
                (
                    'created',
                    organizations.fields.AutoCreatedField(
                        default=django.utils.timezone.now, editable=False),
                ),
                (
                    'modified',
                    organizations.fields.AutoLastModifiedField(
                        default=django.utils.timezone.now, editable=False),
                ),
                (
                    'id',
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    'organization',
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='owner',
                        to='sample_users.organization',
                    ),
                ),
                (
                    'organization_user',
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='sample_users.organizationuser',
                    ),
                ),
            ],
            options={
                'abstract': False,
                'verbose_name': 'organization owner',
                'verbose_name_plural': 'organization owners',
            },
            bases=(organizations.base.UnicodeMixin, models.Model),
        ),
        migrations.AddField(
            model_name='user',
            name='language',
            field=models.CharField(
                choices=settings.LANGUAGES,
                default=settings.LANGUAGE_CODE,
                max_length=8,
            ),
        ),
        migrations.AlterField(
            model_name='organization',
            name='users',
            field=models.ManyToManyField(
                related_name='%(app_label)s_%(class)s',
                through='sample_users.OrganizationUser',
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name='organizationuser',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='%(app_label)s_%(class)s',
                to='sample_users.user',
            ),
        ),
        migrations.CreateModel(
            name='OrganizationInvitation',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('guid', models.UUIDField(editable=False)),
                (
                    'invitee_identifier',
                    models.CharField(
                        help_text=(
                            'The contact identifier for the invitee,'
                            ' email, phone number, social media handle, etc.'),
                        max_length=1000,
                    ),
                ),
                (
                    'created',
                    organizations.fields.AutoCreatedField(
                        default=django.utils.timezone.now, editable=False),
                ),
                (
                    'modified',
                    organizations.fields.AutoLastModifiedField(
                        default=django.utils.timezone.now, editable=False),
                ),
                (
                    'invited_by',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='%(app_label)s_%(class)s_sent_invitations',
                        to='sample_users.user',
                    ),
                ),
                (
                    'invitee',
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='%(app_label)s_%(class)s_invitations',
                        to='sample_users.user',
                    ),
                ),
                (
                    'organization',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='organization_invites',
                        to='sample_users.organization',
                    ),
                ),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
Ejemplo n.º 21
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CarOwner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(max_length=50)),
                ('birth_date', models.DateField()),
                ('passport', models.CharField(max_length=10)),
                ('address', models.CharField(max_length=100)),
                ('nationality', models.CharField(max_length=50)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Car',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('trademark', models.CharField(max_length=50)),
                ('model', models.CharField(max_length=50)),
                ('color', models.CharField(max_length=50)),
                ('number', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Ownership',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('car',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='project_first_app.Car')),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='DriversLicense',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('number', models.CharField(max_length=50)),
                ('date_given', models.DateField()),
                ('type',
                 models.CharField(choices=[('A', 'moto'), ('B', 'autoB'),
                                           ('C', 'autoC'), ('D', 'autoD'),
                                           ('E', 'autoE')],
                                  max_length=1)),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='carowner',
            name='cars',
            field=models.ManyToManyField(through='project_first_app.Ownership',
                                         to='project_first_app.Car'),
        ),
        migrations.AddField(
            model_name='carowner',
            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='carowner',
            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'),
        ),
    ]
Ejemplo n.º 22
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('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')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='姓名')),
                ('birthday',
                 models.DateField(blank=True, null=True, verbose_name='出身年月')),
                ('gender',
                 models.CharField(choices=[('male', '男'), ('female', '女')],
                                  default='female',
                                  max_length=6,
                                  verbose_name='性别')),
                ('mobile', models.CharField(max_length=11,
                                            verbose_name='手机号')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=100,
                                   null=True,
                                   verbose_name='邮箱')),
                ('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': '用户',
                'verbose_name_plural': '用户',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='VerifyCode',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code', models.CharField(max_length=10, verbose_name='验证码')),
                ('mobile', models.CharField(max_length=11,
                                            verbose_name='手机号')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '短信验证码',
                'verbose_name_plural': '短信验证码',
            },
        ),
    ]
Ejemplo n.º 23
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')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('degree',
                 models.CharField(choices=[('1', 'Entered Apprentice'),
                                           ('2', 'Fellow Craft'),
                                           ('3', 'Master Mason')],
                                  default='1',
                                  max_length=1,
                                  verbose_name='degree')),
                ('initiated',
                 models.DateField(blank=True,
                                  help_text='Initiation date.',
                                  null=True,
                                  verbose_name='initiated')),
                ('passed',
                 models.DateField(blank=True,
                                  help_text='Passed to Fellow Craft date.',
                                  null=True,
                                  verbose_name='passed')),
                ('raised',
                 models.DateField(blank=True,
                                  help_text='Raised to Master Mason date.',
                                  null=True,
                                  verbose_name='raised')),
                ('past_master',
                 models.BooleanField(default=False,
                                     help_text='Is or was Worshipful Master.',
                                     verbose_name='past master')),
                ('worshipful',
                 models.BooleanField(
                     default=False,
                     help_text='Is or was elected official of the Grand Lodge.',
                     verbose_name='worshipful')),
                ('most_worshipful',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Is or was elected as Most Worshipful Master of the Grand Lodge.',
                     verbose_name='most worshipful')),
                ('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',
                'ordering': ['last_name', 'first_name'],
                'default_permissions': ('add', 'change', 'delete', 'view'),
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Affiliation',
            fields=[
                ('id',
                 models.BigAutoField(editable=False,
                                     primary_key=True,
                                     serialize=False)),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='is active?')),
                ('created_on',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='created on')),
                ('last_modified_on',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='last modified on')),
            ],
            options={
                'verbose_name': 'affiliation',
                'verbose_name_plural': 'affiliations',
                'ordering': ['-created_on'],
                'default_permissions': ('add', 'change', 'delete', 'view'),
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.BigAutoField(editable=False,
                                     primary_key=True,
                                     serialize=False)),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='is active?')),
                ('created_on',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='created on')),
                ('last_modified_on',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='last modified on')),
                ('name',
                 models.CharField(max_length=50,
                                  unique=True,
                                  verbose_name='name')),
                ('description',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=300,
                                  verbose_name='description')),
                ('created_by',
                 models.ForeignKey(db_index=False,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   related_query_name='+',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='created by')),
                ('last_modified_by',
                 models.ForeignKey(db_index=False,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   related_query_name='+',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='last modified by')),
            ],
            options={
                'verbose_name': 'category',
                'verbose_name_plural': 'categories',
                'ordering': ['name'],
                'default_permissions': ('add', 'change', 'delete', 'view'),
            },
        ),
        migrations.CreateModel(
            name='CategoryPrice',
            fields=[
                ('id',
                 models.BigAutoField(editable=False,
                                     primary_key=True,
                                     serialize=False)),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='is active?')),
                ('created_on',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='created on')),
                ('last_modified_on',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='last modified on')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='price')),
                ('date_from', models.DateField(verbose_name='date from')),
                ('date_until',
                 models.DateField(blank=True,
                                  default=datetime.date(3000, 12, 31),
                                  verbose_name='date until')),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='prices',
                                   related_query_name='price',
                                   to='users.Category',
                                   verbose_name='category')),
                ('created_by',
                 models.ForeignKey(db_index=False,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   related_query_name='+',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='created by')),
                ('last_modified_by',
                 models.ForeignKey(db_index=False,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   related_query_name='+',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='last modified by')),
            ],
            options={
                'verbose_name': 'price',
                'verbose_name_plural': 'prices',
                'ordering': ['-date_until', '-date_from'],
                'default_permissions': ('add', 'change', 'delete', 'view'),
            },
        ),
        migrations.CreateModel(
            name='Lodge',
            fields=[
                ('id',
                 models.BigAutoField(editable=False,
                                     primary_key=True,
                                     serialize=False)),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='is active?')),
                ('created_on',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='created on')),
                ('last_modified_on',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='last modified on')),
                ('name',
                 models.CharField(max_length=150,
                                  unique=True,
                                  verbose_name='name')),
                ('created_by',
                 models.ForeignKey(db_index=False,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   related_query_name='+',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='created by')),
                ('last_modified_by',
                 models.ForeignKey(db_index=False,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   related_query_name='+',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='last modified by')),
                ('treasurer',
                 models.ForeignKey(blank=True,
                                   db_index=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   related_query_name='+',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='treasurer')),
            ],
            options={
                'verbose_name': 'lodge',
                'verbose_name_plural': 'lodges',
                'ordering': ['name'],
                'default_permissions': ('add', 'change', 'delete', 'view'),
            },
        ),
        migrations.AddField(
            model_name='affiliation',
            name='category',
            field=models.ForeignKey(
                db_index=False,
                on_delete=django.db.models.deletion.PROTECT,
                related_name='affiliations',
                related_query_name='affiliation',
                to='users.Category',
                verbose_name='category'),
        ),
        migrations.AddField(
            model_name='affiliation',
            name='created_by',
            field=models.ForeignKey(
                db_index=False,
                on_delete=django.db.models.deletion.PROTECT,
                related_name='+',
                related_query_name='+',
                to=settings.AUTH_USER_MODEL,
                verbose_name='created by'),
        ),
        migrations.AddField(
            model_name='affiliation',
            name='last_modified_by',
            field=models.ForeignKey(
                db_index=False,
                on_delete=django.db.models.deletion.PROTECT,
                related_name='+',
                related_query_name='+',
                to=settings.AUTH_USER_MODEL,
                verbose_name='last modified by'),
        ),
        migrations.AddField(
            model_name='affiliation',
            name='lodge',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name='affiliations',
                related_query_name='affiliation',
                to='users.Lodge',
                verbose_name='lodge'),
        ),
        migrations.AddField(
            model_name='affiliation',
            name='user',
            field=models.ForeignKey(
                db_index=False,
                on_delete=django.db.models.deletion.PROTECT,
                related_name='affiliations',
                related_query_name='affiliation',
                to=settings.AUTH_USER_MODEL,
                verbose_name='user'),
        ),
        migrations.AlterUniqueTogether(
            name='affiliation',
            unique_together={('lodge', 'user')},
        ),
        migrations.AlterIndexTogether(
            name='affiliation',
            index_together={('lodge', 'user')},
        ),
    ]
Ejemplo n.º 24
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='CustomUser',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     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=254, verbose_name='full name')),
                ('short_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='short name')),
                ('sex',
                 models.CharField(choices=[('Male', 'Male'),
                                           ('Female', 'Female')],
                                  max_length=30,
                                  verbose_name='sex')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('phone_number',
                 models.CharField(max_length=20,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          re.compile('^[0-9]+$'),
                                          'Only numbers are allowed.',
                                          'invalid')
                                  ],
                                  verbose_name='phone number')),
                ('user_type',
                 models.CharField(choices=[('Driver', 'Driver'),
                                           ('Passenger', 'Passenger')],
                                  max_length=30,
                                  verbose_name='user type')),
                ('address',
                 models.TextField(max_length=400, verbose_name='location')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_verified',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user is a vershified user',
                     verbose_name='user verified')),
                ('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')),
                ('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', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Vehicle',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('year', models.IntegerField(verbose_name='year of purchase')),
                ('make',
                 models.CharField(max_length=254,
                                  verbose_name='vehicle make')),
                ('plate',
                 models.CharField(max_length=10,
                                  verbose_name='liscenced plate number')),
                ('model',
                 models.CharField(max_length=254,
                                  verbose_name='vehicle model')),
                ('seats', models.IntegerField(verbose_name='no of seats')),
                ('type',
                 models.CharField(choices=[('private', 'private'),
                                           ('hired', 'hired')],
                                  max_length=30,
                                  verbose_name='vehicle type')),
                ('category',
                 models.CharField(choices=[('Car', 'Car'), ('Bus', 'Bus'),
                                           ('Coaster', 'Coaster'),
                                           ('Truck', 'Truck')],
                                  max_length=30,
                                  verbose_name='vehicle category')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='VehicleSharing',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('start',
                 models.CharField(max_length=256,
                                  verbose_name='starting point')),
                ('dest',
                 models.CharField(max_length=256, verbose_name='destination')),
                ('cost', models.IntegerField(verbose_name='cost')),
                ('date',
                 models.DateField(default=django.utils.timezone.now,
                                  verbose_name='date')),
                ('start_time',
                 models.TimeField(max_length=256, verbose_name='start time')),
                ('arrival_time',
                 models.TimeField(max_length=256,
                                  verbose_name='estimated arrivak')),
                ('no_pass',
                 models.IntegerField(verbose_name='no of passengers')),
                ('details', models.TextField(verbose_name='ride details')),
                ('sex',
                 models.CharField(choices=[('Male', 'Male'),
                                           ('Female', 'Female'),
                                           ('Both', 'Both')],
                                  max_length=30,
                                  verbose_name='gender preference')),
                ('ended',
                 models.BooleanField(default=False,
                                     verbose_name='sharing ended')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('vehicle',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='carapp.vehicle')),
            ],
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('pick',
                 models.CharField(max_length=256,
                                  verbose_name='pick up point')),
                ('dest',
                 models.CharField(max_length=256, verbose_name='destination')),
                ('reg_date',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='registration date')),
                ('bearable',
                 models.IntegerField(verbose_name='bearable cost')),
                ('status',
                 models.CharField(default='pending',
                                  max_length=256,
                                  verbose_name='status')),
                ('ride',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='carapp.vehiclesharing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('picture',
                 models.FileField(blank=True, default='user.png',
                                  upload_to='')),
                ('education', models.TextField(blank=True)),
                ('work', models.TextField(blank=True)),
                ('social_facebook', models.CharField(blank=True,
                                                     max_length=256)),
                ('social_twitter', models.CharField(blank=True,
                                                    max_length=256)),
                ('social_instagram',
                 models.CharField(blank=True, max_length=256)),
                ('bio', models.TextField(blank=True)),
                ('is_public', models.BooleanField(default=False)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('subject',
                 models.CharField(default='(No Subject)', max_length=256)),
                ('message', models.TextField()),
                ('date',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='time sent')),
                ('read', models.BooleanField(default=False,
                                             verbose_name='read')),
                ('deleted',
                 models.BooleanField(default=False, verbose_name='deleted')),
                ('recipient',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='recipient',
                                   to=settings.AUTH_USER_MODEL)),
                ('sender',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sender',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Follow',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('time',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='time')),
                ('followee',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='followee',
                                   to=settings.AUTH_USER_MODEL)),
                ('follower',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='follower',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='DriverInfo',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('liscence_no',
                 models.CharField(max_length=30,
                                  verbose_name='liscence number')),
                ('date_issuance',
                 models.DateField(blank=True,
                                  verbose_name='date of first issuance')),
                ('scanned',
                 models.ImageField(
                     blank=True,
                     upload_to='',
                     verbose_name="picture of driver's liscence")),
                ('confirmed',
                 models.BooleanField(default=False, verbose_name='confirmed')),
                ('driver',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 25
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('nick_name',
                 models.CharField(default='', max_length=50,
                                  verbose_name='昵称')),
                ('birthday',
                 models.DateField(blank=True, null=True, verbose_name='生日')),
                ('gender',
                 models.CharField(choices=[('male', '男'), ('female', '女')],
                                  default='female',
                                  max_length=6)),
                ('address', models.CharField(default='', max_length=100)),
                ('mobile',
                 models.CharField(blank=True, max_length=11, null=True)),
                ('image',
                 models.ImageField(default='image/default.png',
                                   upload_to='image/%Y/%m')),
                ('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': '用户信息',
                'verbose_name_plural': '用户信息',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='标题')),
                ('image',
                 models.ImageField(upload_to='banner/%Y/%m',
                                   verbose_name='轮播图')),
                ('url', models.URLField(verbose_name='访问地址')),
                ('index', models.IntegerField(default=100, verbose_name='顺序')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '轮播图',
                'verbose_name_plural': '轮播图',
            },
        ),
        migrations.CreateModel(
            name='EmailVerifyRecord',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code', models.CharField(max_length=20, verbose_name='验证码')),
                ('email', models.EmailField(max_length=50, verbose_name='邮箱')),
                ('send_type',
                 models.CharField(choices=[('register', '注册'),
                                           ('forget', '找回密码'),
                                           ('update_email', '修改邮箱')],
                                  max_length=30,
                                  verbose_name='验证码类型')),
                ('send_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='发送时间')),
            ],
            options={
                'verbose_name': '邮箱验证码',
                'verbose_name_plural': '邮箱验证码',
            },
        ),
    ]
Ejemplo n.º 26
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CustomUser',
            fields=[
                ('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')),
                ('accountNumber',
                 models.AutoField(primary_key=True, serialize=False)),
                ('username', models.CharField(max_length=50, unique=True)),
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(default='', max_length=50)),
                ('email', models.EmailField(max_length=254)),
                ('address', models.CharField(default='', max_length=50)),
                ('city', models.CharField(default='', max_length=50)),
                ('state', models.CharField(default='', max_length=2)),
                ('zipCode', models.CharField(default='', max_length=5)),
                ('phoneNumber',
                 models.CharField(default='1112223333', max_length=10)),
                ('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',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ATM_Card',
            fields=[
                ('atmCardNumber',
                 models.AutoField(primary_key=True, serialize=False)),
                ('pin', models.CharField(default='', max_length=4)),
                ('name', models.CharField(default='', max_length=50)),
                ('dateOfIssue', models.CharField(default='', max_length=50)),
                ('expirationDate', models.CharField(default='',
                                                    max_length=50)),
                ('address', models.CharField(default='', max_length=50)),
                ('phoneNumber',
                 models.CharField(default='1112223333', max_length=10)),
                ('cardStatus', models.BooleanField(default=True)),
                ('twoFactorAuthenticationStatus',
                 models.BooleanField(default=True)),
                ('accountNumber',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ATMachine',
            fields=[
                ('ATMachineUID',
                 models.AutoField(primary_key=True, serialize=False)),
                ('currentBalance', models.PositiveIntegerField(default=0)),
                ('location', models.CharField(default='', max_length=100)),
                ('minimumBalance', models.PositiveIntegerField(default=1000)),
                ('status', models.CharField(default='', max_length=50)),
                ('lastRefillDate', models.DateField(default='',
                                                    max_length=50)),
                ('nextMaintenanceDate',
                 models.DateField(default='', max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='BalanceEnquiry',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('balanceAmount', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='CashTransfer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('beneficiaryAccountNumber',
                 models.CharField(default='', max_length=50)),
                ('beneficiaryName', models.CharField(default='',
                                                     max_length=50)),
                ('amountTransferred', models.PositiveIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='CashWithdrawal',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('amountTransferred', models.PositiveIntegerField(default=0)),
                ('denomination', models.CharField(default='', max_length=50)),
                ('currentBalance', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='PhoneChange',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('newPhoneNumber',
                 models.CharField(default='1112223333', max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='PinChange',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('previousPin', models.CharField(default='', max_length=4)),
                ('newPin', models.CharField(default='', max_length=4)),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('transactionId',
                 models.AutoField(primary_key=True, serialize=False)),
                ('date', models.DateField(default='', max_length=50)),
                ('status', models.CharField(default='', max_length=50)),
                ('responseCode', models.CharField(default='', max_length=50)),
                ('transactionType', models.CharField(default='',
                                                     max_length=50)),
                ('ATMCardNumber',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='users.ATM_Card')),
                ('ATMachineUID',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='users.ATMachine')),
            ],
        ),
        migrations.CreateModel(
            name='ATMachineRefill',
            fields=[
                ('refillId', models.AutoField(primary_key=True,
                                              serialize=False)),
                ('amount', models.PositiveIntegerField(default=0)),
                ('atmBranch', models.CharField(default='', max_length=50)),
                ('refillDate', models.DateField(default='', max_length=50)),
                ('previousBalance', models.PositiveIntegerField(default=0)),
                ('ATMachineUID',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='users.ATMachine')),
            ],
        ),
        migrations.CreateModel(
            name='AccountExtension',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(default='', max_length=50)),
                ('phoneNumber',
                 models.CharField(default='1112223333', max_length=10)),
                ('balance', models.IntegerField(default=0)),
                ('accountNumber',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 27
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')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('avatar', models.ImageField(blank=True, upload_to='avatar')),
                ('gender',
                 models.CharField(blank=True,
                                  choices=[('male', 'Male'),
                                           ('female', 'Female')],
                                  max_length=10)),
                ('bio', models.TextField(blank=True)),
                ('birthDate',
                 models.DateField(default=django.utils.timezone.now)),
                ('language',
                 models.CharField(blank=True,
                                  max_length=2,
                                  verbose_name=[('kr', 'Korean'),
                                                ('en', 'English')])),
                ('currency',
                 models.CharField(blank=True,
                                  choices=[('usd', 'USD'), ('krw', 'KRW')],
                                  max_length=3)),
                ('superHost', models.BooleanField(default=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')),
                ('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',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
Ejemplo n.º 28
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
    ]

    operations = [
        migrations.CreateModel(
            name='Libitem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('itemtype',
                 models.CharField(choices=[('Book', 'Book'), ('DVD', 'DVD'),
                                           ('Other', 'Other')],
                                  default='Book',
                                  max_length=6)),
                ('checked_out', models.BooleanField(default=False)),
                ('duedate',
                 models.DateField(blank=True, default=None, null=True)),
                ('last_chkout',
                 models.DateField(blank=True, default=None, null=True)),
                ('date_acquired',
                 models.DateField(default=datetime.date(2016, 5, 18))),
                ('pubyr', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Libuser',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('address',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('city', models.CharField(default='Windsor', max_length=20)),
                ('province',
                 models.CharField(choices=[
                     ('AB', 'Alberta'), ('MB', 'Manitoba'), ('ON', 'Ontario'),
                     ('QC', 'Quebec')
                 ],
                                  default='ON',
                                  max_length=2)),
                ('age', models.IntegerField()),
                ('phone', models.IntegerField(null=True)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='libitem',
            name='user',
            field=models.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='libapp.Libuser'),
        ),
    ]
Ejemplo n.º 29
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')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('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')),
                ('username',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('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',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=5)),
                ('dob', models.DateField()),
                ('address', models.CharField(max_length=255)),
                ('country', models.CharField(max_length=50)),
                ('city', models.CharField(max_length=50)),
                ('zip', models.CharField(max_length=5)),
                ('photo', models.ImageField(blank=True, upload_to='uploads')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 30
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='last 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')),
                ('idcardnumber',
                 models.CharField(blank=True,
                                  max_length=18,
                                  null=True,
                                  verbose_name='身份证号')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='姓名')),
                ('gender',
                 models.CharField(choices=[('male', '男'), ('female', '女')],
                                  default='female',
                                  max_length=6,
                                  verbose_name='性别')),
                ('mobile',
                 models.CharField(blank=True,
                                  max_length=11,
                                  null=True,
                                  verbose_name='电话')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=100,
                                   null=True,
                                   verbose_name='邮箱')),
                ('joinedyears',
                 models.DateField(blank=True, null=True,
                                  verbose_name='参加工作年月')),
                ('education',
                 models.IntegerField(
                     choices=[(1, '高中(中专)及以下'), (2, '大学专科'), (3, '大学本科'),
                              (4, '硕士研究生'), (5, '博士研究生及以上')],
                     default=1,
                     help_text=
                     '学历: 1高中(中专)及以下,2(大学专科),3(大学本科),4(硕士研究生),5(博士研究生及以上)',
                     verbose_name='学历')),
                ('title',
                 models.IntegerField(choices=[(1, '无'), (2, '初级'), (3, '中级'),
                                              (4, '高级')],
                                     default=1,
                                     help_text='职称: 1(无),2(初级),3(中级),4(高级)',
                                     verbose_name='职称')),
                ('internel_trainer',
                 models.IntegerField(choices=[(1, '无'), (2, '初级'), (3, '中级'),
                                              (4, '高级')],
                                     default=1,
                                     help_text='内训师: 1(无),2(初级),3(中级),4(高级)',
                                     verbose_name='内训师')),
                ('cmanagerlevel',
                 models.IntegerField(
                     choices=[(1, '无'), (2, '一等'), (3, '二等'),
                              (4, '三等')],
                     default=1,
                     help_text='客户经理等次: 1(无),2(一等),3(二等),4(三等)',
                     verbose_name='客户经理等次')),
                ('cmanagerrank',
                 models.IntegerField(
                     choices=[(1, '无'), (2, '初级'), (3, '中级'),
                              (4, '高级')],
                     default=1,
                     help_text='客户经理级次: 1(无),2(初级),3(中级),4(高级)',
                     verbose_name='客户经理级次')),
                ('clerkrank',
                 models.IntegerField(
                     choices=[(1, '无'), (2, '见习柜员'), (3, '初级柜员'), (4, '中级柜员'),
                              (5, '高级柜员'),
                              (6, '资深柜员')],
                     default=1,
                     help_text='柜员等级: 1(无),2(见习),3(初级),4(中级),5(高级),6(资深)',
                     verbose_name='柜员等级')),
                ('primccbp',
                 models.IntegerField(default=0,
                                     help_text='初级银行从业',
                                     verbose_name='初级银行从业')),
                ('intermediateccbp',
                 models.IntegerField(default=0,
                                     help_text='中级银行从业',
                                     verbose_name='中级银行从业')),
                ('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': '用户',
                'verbose_name_plural': '用户',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]