Example #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('config', '0011_cartswitch'),
        ('wxapp', '0004_auto_20181116_1501'),
        ('account', '0013_wxuseraccountlog_note'),
    ]

    operations = [
        migrations.CreateModel(
            name='RechargeRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rchg_no', models.CharField(db_index=True, default=apps.account.models.generate_rg_no, max_length=128, unique=True, verbose_name='充值编号')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=19, verbose_name='充值金额')),
                ('real_pay', models.DecimalField(decimal_places=2, max_digits=19, verbose_name='支付金额')),
                ('trade_no', models.CharField(blank=True, max_length=100, null=True, unique=True, verbose_name='微信交易号')),
                ('status', models.CharField(choices=[('paid', '已支付'), ('unpaid', '未支付')], default='unpaid', max_length=128, verbose_name='充值状态')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='充值时间')),
                ('wxuser', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='recharge_records', to='wxapp.WxUser', verbose_name='用户')),
            ],
            options={
                'verbose_name': '充值记录',
                'verbose_name_plural': '充值记录',
                'ordering': ('-create_time',),
            },
        ),
        migrations.CreateModel(
            name='UserLevel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('level', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='users', to='config.Level', verbose_name='会员等级')),
                ('wxuser', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='level', to='wxapp.WxUser', verbose_name='用户')),
            ],
            options={
                'verbose_name': '用户等级',
                'verbose_name_plural': '用户等级',
            },
        ),
        migrations.AddField(
            model_name='wxuseraccount',
            name='recharge',
            field=models.DecimalField(decimal_places=2, default=0, max_digits=30, verbose_name='充值余额'),
        ),
        migrations.AddField(
            model_name='wxuseraccount',
            name='total_recharge',
            field=models.DecimalField(decimal_places=2, default=0, max_digits=30, verbose_name='累计充值实付金额'),
        ),
    ]
Example #2
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')),
                ('email', models.EmailField(error_messages={'unique': 'Данная почта уже используется.'}, help_text='На почту приходит подтверждение и различная важная информация.', max_length=255, unique=True, verbose_name='Адрес электронной почты')),
                ('email_confirmed', 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', apps.account.models.UserManager()),
            ],
        ),
    ]
Example #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_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')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='Email')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='surname')),
                ('user_phone', models.BigIntegerField(blank=True, null=True, verbose_name='Номер телефона')),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=True)),
                ('date_joined', models.DateTimeField(auto_now_add=True, verbose_name='registered')),
                ('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': 'Пользователи',
                'ordering': ('email',),
            },
            managers=[
                ('objects', apps.account.models.UserManager()),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('account', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='user',
            name='avatar',
            field=models.FileField(blank=True, null=True, storage=conf.storage.OverwriteStorage(), upload_to=apps.account.models.User.upload_avatar_path, verbose_name='Uploaded avatar of profile'),
        ),
        migrations.AddField(
            model_name='user',
            name='name',
            field=models.CharField(blank=True, default='', max_length=255),
        ),
    ]
Example #5
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={
                         'blank': 'Обязательно к заполнению.',
                         'invalid': 'Некорректное имя пользователя.',
                         'null': 'Обязательно к заполнению.',
                         'required': 'Обязательно к заполнению.',
                         'unique':
                         'Пользователь с таким именем уже существует.'
                     },
                     help_text=
                     'Имя, которое будет отображаться для всех пользователей.',
                     max_length=60,
                     unique=True,
                     validators=[apps.account.models.UsernameValidator()],
                     verbose_name='Имя пользователя')),
                ('email',
                 models.EmailField(
                     error_messages={
                         'unique': 'Данная почта уже используется.'
                     },
                     help_text=
                     'На почту приходит подтверждение и различная важная информация.',
                     max_length=255,
                     unique=True,
                     verbose_name='Адрес электронной почты')),
                ('email_confirmed', models.BooleanField(default=False)),
                ('first_name',
                 models.CharField(
                     blank=True,
                     help_text='Можно как в паспорте.',
                     max_length=50,
                     validators=[apps.account.models.FIOValidator()],
                     verbose_name='Имя')),
                ('second_name',
                 models.CharField(
                     blank=True,
                     help_text='Можно как в паспорте.',
                     max_length=50,
                     validators=[apps.account.models.FIOValidator()],
                     verbose_name='Отчество')),
                ('last_name',
                 models.CharField(
                     blank=True,
                     help_text='Можно как в паспорте.',
                     max_length=50,
                     validators=[apps.account.models.FIOValidator()],
                     verbose_name='Фамилия')),
                ('avatar',
                 models.ImageField(
                     default='avatars/no-avatar.svg',
                     help_text='Графическое представление пользователя.',
                     upload_to=apps.account.models.avatar_directory_path,
                     verbose_name='Аватар')),
                ('date_of_birth',
                 models.DateField(help_text='Дата рождения пользователя.',
                                  null=True,
                                  verbose_name='Дата рождения')),
                ('experience',
                 models.IntegerField(default=0,
                                     help_text='Опыт пользователя.',
                                     verbose_name='Опыт')),
                ('is_staff',
                 models.BooleanField(default=False,
                                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(default=True, 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', apps.account.models.UserManager()),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('wxapp', '0003_wxuser_testers'),
        ('account', '0005_auto_20180724_0947'),
    ]

    operations = [
        migrations.CreateModel(
            name='Withdraw',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('withdraw_no',
                 models.CharField(default=apps.account.models.generate_wd_no,
                                  max_length=128,
                                  unique=True,
                                  verbose_name='提现单号')),
                ('amount',
                 models.DecimalField(decimal_places=2,
                                     max_digits=19,
                                     verbose_name='提现金额')),
                ('wx_code', models.CharField(max_length=128,
                                             verbose_name='微信号')),
                ('add_time',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='提现发起时间')),
                ('succ_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='完成时间')),
                ('remark',
                 models.CharField(blank=True,
                                  max_length=256,
                                  null=True,
                                  verbose_name='备注')),
                ('status',
                 models.CharField(choices=[(0, '提现中'), (1, '提现失败'),
                                           (2, '提现完成')],
                                  default=0,
                                  max_length=128,
                                  verbose_name='提现状态')),
                ('wxuser',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='withdraw_logs',
                                   to='wxapp.WxUser',
                                   verbose_name='用户')),
            ],
            options={
                'verbose_name': '提现记录',
                'verbose_name_plural': '提现记录',
                'ordering': ('status', '-add_time'),
            },
        ),
        migrations.AlterField(
            model_name='wxuseraccountlog',
            name='a_type',
            field=models.CharField(choices=[('asset', '分销'), ('use', '抵现'),
                                            ('use_return', '取消订单返还'),
                                            ('withdraw', '提现'),
                                            ('fail_withdraw_return', '提现失败返还')
                                            ],
                                   max_length=32,
                                   verbose_name='类型'),
        ),
    ]
Example #7
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.ASCIIUsernameValidator(
                         )
                     ],
                     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')),
                ('birthday',
                 models.DateField(default=datetime.date.today,
                                  verbose_name=b'Birthday')),
                ('number',
                 models.IntegerField(
                     default=apps.account.models.get_random_number,
                     verbose_name=b'Number')),
                ('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={
                'abstract': False,
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
Example #8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=255,
                                  verbose_name='Name')),
                ('plan',
                 models.CharField(choices=[('trial', 'Trial'), ('pro', 'Pro')],
                                  default='trial',
                                  max_length=255)),
                ('plan_end_at',
                 models.DateTimeField(default=apps.account.models.trial_time)),
                ('plan_limit', models.PositiveIntegerField(default=10)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='User',
            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(
                     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')),
                ('role',
                 models.CharField(choices=[('admin', 'Admin'),
                                           ('member', 'Member')],
                                  default='member',
                                  max_length=255,
                                  verbose_name='Role')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='Name')),
                ('account',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='account.account')),
                ('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()),
            ],
        ),
    ]
Example #9
0
class Migration(migrations.Migration):

    initial = True

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

    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')),
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100, verbose_name='名前')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='メールアドレス')),
                ('is_staff',
                 models.BooleanField(default=False,
                                     help_text='管理画面にアクセスすることができる.',
                                     verbose_name='スタッフ権限')),
                ('is_active',
                 models.BooleanField(default=True,
                                     help_text='有効なユーザである.',
                                     verbose_name='有効なユーザ')),
                ('is_superuser',
                 models.BooleanField(default=False,
                                     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': 'ユーザ',
                'db_table': 'users',
            },
            managers=[
                ('objects', apps.account.models.UserManager()),
            ],
        ),
    ]
Example #10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_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')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('first_name',
                 models.CharField(max_length=30, verbose_name='first name')),
                ('last_name',
                 models.CharField(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')),
                ('is_trusty',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether this user has confirmed his accounts.',
                     verbose_name='trusty')),
                ('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', apps.account.models.UserManager()),
            ],
        ),
    ]
Example #11
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')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('phone',
                 models.CharField(max_length=12,
                                  unique=True,
                                  verbose_name='Phone number or 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')),
                ('date_joined',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Date joined')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='Active')),
                ('email',
                 models.EmailField(blank=True, max_length=254, null=True)),
            ],
            options={
                'verbose_name': 'User',
                'verbose_name_plural': 'Users',
            },
            managers=[
                ('objects', apps.account.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('address',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Client address')),
            ],
        ),
        migrations.CreateModel(
            name='DeliveryAddress',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('address', models.TextField()),
                ('email', models.EmailField(max_length=60)),
                ('phone', models.CharField(max_length=60)),
                ('is_default', models.BooleanField(default=False)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Files',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file',
                 models.FileField(default='default.png', upload_to='files/')),
            ],
            options={
                'verbose_name': 'File',
                'verbose_name_plural': 'Files',
            },
        ),
        migrations.CreateModel(
            name='Merchant',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('merchant_type',
                 models.IntegerField(choices=[(1, 'Producer'),
                                              (2, 'Supplier')],
                                     verbose_name='Merchant type')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='merchant',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='Merchant user')),
            ],
        ),
        migrations.CreateModel(
            name='PaymentCards',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('card_holder',
                 models.CharField(max_length=60, verbose_name='Name on card')),
                ('cart_number',
                 models.CharField(max_length=60, verbose_name='Card number')),
                ('expiration_date',
                 models.DateField(default=datetime.date(2030, 2, 3))),
                ('billing_address', models.TextField(blank=True, null=True)),
                ('is_default', models.BooleanField(default=False)),
                ('holder',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Payment method',
                'verbose_name_plural': 'Payment methods',
            },
        ),
        migrations.AddField(
            model_name='client',
            name='delivery_address',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='account.DeliveryAddress'),
        ),
        migrations.AddField(
            model_name='client',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='client',
                to=settings.AUTH_USER_MODEL,
                verbose_name='Client user'),
        ),
        migrations.AddField(
            model_name='user',
            name='avatar',
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='account.Files',
                verbose_name='Avatar'),
        ),
        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'),
        ),
    ]
Example #12
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')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      null=True,
                                      verbose_name='time of creation')),
                ('updated_at',
                 models.DateTimeField(auto_now=True,
                                      null=True,
                                      verbose_name='last modification time')),
                ('email',
                 models.EmailField(
                     default='',
                     error_messages={
                         'unique':
                         'A user with that email address already exists.'
                     },
                     max_length=254,
                     unique=True,
                     verbose_name='email address')),
                ('first_name',
                 models.CharField(default='',
                                  max_length=32,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(default='',
                                  max_length=32,
                                  verbose_name='last name')),
                ('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')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_volunteer',
                 models.BooleanField(default=False,
                                     verbose_name='volunteer status')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', apps.account.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ProxyGroup',
            fields=[],
            options={
                'verbose_name': 'group',
                'verbose_name_plural': 'groups',
                'proxy': True,
                'default_permissions': (),
                'indexes': [],
            },
            bases=('auth.group', ),
            managers=[
                ('objects', django.contrib.auth.models.GroupManager()),
            ],
        ),
        migrations.CreateModel(
            name='ProxyPermission',
            fields=[],
            options={
                'verbose_name': 'permission',
                'verbose_name_plural': 'permissions',
                'proxy': True,
                'default_permissions': (),
                'indexes': [],
            },
            bases=('auth.permission', ),
            managers=[
                ('objects', django.contrib.auth.models.PermissionManager()),
            ],
        ),
        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):

    dependencies = [
        ('account', '0002_auto_20191208_0442'),
    ]

    operations = [
        migrations.CreateModel(
            name='DealWatchGroup',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('source', models.CharField(max_length=20)),
                ('destination', models.CharField(max_length=20)),
                ('airlines',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('last_updated', models.DateTimeField(blank=True, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='dealwatch',
            name='timestamp',
            field=models.DateTimeField(auto_now_add=True,
                                       default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='companioninvite',
            name='invite_code',
            field=models.CharField(
                default=apps.account.models.generate_invite_code,
                max_length=50),
        ),
        migrations.AlterField(
            model_name='dealwatch',
            name='airlines',
            field=django.contrib.postgres.fields.ArrayField(
                base_field=models.CharField(max_length=10),
                blank=True,
                default=list,
                size=None),
        ),
        migrations.AlterField(
            model_name='dealwatch',
            name='max_price',
            field=models.DecimalField(blank=True,
                                      decimal_places=2,
                                      max_digits=10,
                                      null=True),
        ),
        migrations.AddField(
            model_name='dealwatch',
            name='group',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name='watches',
                to='account.DealWatchGroup'),
        ),
    ]