コード例 #1
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=30, null=True)),
                ('middle_name', models.CharField(blank=True, max_length=30, null=True)),
                ('last_name', models.CharField(blank=True, max_length=30, null=True)),
                ('profile_image', models.ImageField(blank=True, null=True, upload_to=accounts.models.profile_image_upload_location)),
                ('age', models.IntegerField(default=10)),
                ('sex', models.CharField(blank=True, choices=[('Male', 'Male'), ('Female', 'Female')], max_length=20, null=True)),
                ('marital_status', models.CharField(blank=True, choices=[('Single', 'Single'), ('Maried', 'Maried')], max_length=10, null=True)),
                ('phone', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region=None)),
                ('email', models.EmailField(max_length=500)),
                ('address', models.TextField(blank=True, null=True)),
                ('school', models.CharField(blank=True, max_length=500, null=True)),
                ('year_completed', models.BigIntegerField(blank=True, default=1990, null=True)),
                ('qualification', models.CharField(blank=True, choices=[('Higher Secondary', 'Higher Secondary'), ('Bachelor Degree', 'Bachelor Degree'), ('Master Degree', 'Master Degree')], max_length=50, null=True)),
                ('certificate', models.ImageField(blank=True, height_field='height_field', null=True, upload_to=accounts.models.certificate_upload_location, width_field='width_field')),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('education_additional_information', models.TextField(blank=True, null=True)),
                ('company', models.CharField(blank=True, max_length=500, null=True)),
                ('job_position', models.CharField(blank=True, max_length=500, null=True)),
                ('salary', models.BigIntegerField(default=0)),
                ('website', models.CharField(blank=True, max_length=500, null=True)),
                ('location', models.CharField(blank=True, max_length=500, null=True)),
                ('work_experience', models.CharField(blank=True, choices=[('1 Year to 2 Years', '1 Year to 2 Years'), ('2 Yeasr to 3 Years', '2 Years to 3 Years'), ('3 Years to 4 Years', '3 Years to 4 Years'), ('4 Years to 5 Years', '4 Years to 5 Years'), ('5 Years +', '5 Years +')], max_length=50, null=True)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('resume', models.FileField(blank=True, null=True, upload_to=accounts.models.resume_upload_location)),
                ('work_additional_information', models.TextField(blank=True, null=True)),
                ('refree_1', models.CharField(blank=True, max_length=100, null=True)),
                ('refree_1_phone', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region=None)),
                ('refree_2', models.CharField(blank=True, max_length=100, null=True)),
                ('refree_2_phone', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region=None)),
                ('is_tutor', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
                ('city', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tutor_city', to='locations.Location')),
                ('subjects', models.ManyToManyField(blank=True, to='subjects.Subject')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Testimonials',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('testimony', models.TextField(blank=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to='accounts.UserProfile')),
            ],
        ),
    ]
コード例 #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CK',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', ckeditor_uploader.fields.RichTextUploadingField()),
            ],
        ),
        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(max_length=254, unique=True)),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=150)),
                ('subject', models.CharField(max_length=100)),
                ('chapter', models.CharField(max_length=100)),
                ('is_permitted', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=True)),
                ('is_active', models.BooleanField(default=False)),
                ('is_admin', 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={
                'abstract': False,
            },
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        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')),
                ('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')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=50,
                                  null=True,
                                  validators=[accounts.models.validate_name])),
                ('MobileNumber',
                 phonenumber_field.modelfields.PhoneNumberField(blank=True,
                                                                max_length=128,
                                                                null=True,
                                                                region=None)),
                ('dob', models.DateField(blank=True, max_length=8, 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='Areas',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('volunteerNumber',
                 models.PositiveSmallIntegerField(default=None)),
                ('areaLead',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Area_Linker',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('area',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Areas')),
                ('volunteer',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Avatars',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('avatar',
                 models.ImageField(
                     blank=True,
                     default='static/img/avatars/default.jpg',
                     upload_to=accounts.models.user_directory_path,
                     verbose_name='Avatar')),
                ('uploaded_at',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Atualizado em')),
            ],
            options={
                'verbose_name': 'Avatar',
                'verbose_name_plural': 'Avatares',
                'db_table': 'avatars',
            },
        ),
        migrations.CreateModel(
            name='BasicUser',
            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')),
                ('active',
                 models.BooleanField(default=True, verbose_name='Ativo')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Cadastrado em')),
                ('email',
                 models.EmailField(max_length=255,
                                   null=True,
                                   unique=True,
                                   verbose_name='Email')),
                ('first_name',
                 models.CharField(max_length=255,
                                  null=True,
                                  verbose_name='Primeiro nome')),
                ('last_name',
                 models.CharField(max_length=255,
                                  null=True,
                                  verbose_name='Último nome')),
                ('username',
                 models.CharField(
                     max_length=12,
                     unique=True,
                     validators=[
                         django.core.validators.MinLengthValidator(12)
                     ],
                     verbose_name='Usuário Enel')),
                ('profile',
                 models.CharField(choices=[('0', 'Administrador'),
                                           ('1', 'Planejamento'),
                                           ('2', 'Execução'), ('3', 'Obras'),
                                           ('4', 'Telecontrole'),
                                           ('5', 'Telecom'), ('6', 'Proteção'),
                                           ('7', 'Visualização')],
                                  max_length=255,
                                  verbose_name='Perfil')),
                ('superuser',
                 models.BooleanField(default=False,
                                     verbose_name='Administrador')),
                ('avatars',
                 models.ManyToManyField(blank=True,
                                        to='accounts.Avatars',
                                        verbose_name='Avatar')),
                ('created_by',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Cadastrado por')),
                ('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': 'Usuário',
                'verbose_name_plural': 'Usuários',
                'db_table': 'Users',
            },
        ),
    ]
コード例 #5
0
ファイル: 0001_initial.py プロジェクト: hamidrouhi/whoami
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email',
                 models.EmailField(
                     error_messages={'unique': 'این ایمیل قبلا ثبت شده است.'},
                     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', accounts.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('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')),
                ('mobile', models.CharField(blank=True, max_length=30)),
                ('bio', models.TextField(blank=True, max_length=500)),
                ('birth_date',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='birth date')),
                ('gender',
                 models.CharField(choices=[('n', 'no-binary'), ('m', 'male'),
                                           ('f', 'female')],
                                  default='n',
                                  max_length=1,
                                  verbose_name='gender')),
                ('avatar',
                 models.ImageField(upload_to=accounts.models.upload_to)),
                ('owner',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #6
0
ファイル: 0001_initial.py プロジェクト: kakamband/mtp-web
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        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')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('username',
                 models.CharField(
                     max_length=100,
                     unique=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             '^[0-9a-zA-Z]*$',
                             'Only alphanumeric characters are allowed for Username.'
                         )
                     ])),
                ('is_active', models.BooleanField(default=False)),
                ('is_maillist', models.BooleanField(default=False)),
                ('mapillary_access_token',
                 models.TextField(blank=True, default='', null=True)),
                ('verify_email_key',
                 models.CharField(default='', max_length=100)),
                ('avatar',
                 models.ImageField(
                     blank=True,
                     null=True,
                     storage=storages.backends.s3boto3.S3Boto3Storage(
                         bucket=''),
                     upload_to=accounts.models.image_directory_path)),
                ('first_name',
                 models.CharField(
                     blank=True,
                     max_length=30,
                     null=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             '^[a-zA-Z]*$',
                             'Only alpha characters are allowed for Username.')
                     ])),
                ('last_name',
                 models.CharField(
                     blank=True,
                     max_length=30,
                     null=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             '^[a-zA-Z]*$',
                             'Only alpha characters are allowed for Username.')
                     ])),
                ('website_url', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, 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,
            },
        ),
        migrations.CreateModel(
            name='MapillaryUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('username', models.CharField(max_length=100, null=True)),
                ('key', models.CharField(max_length=100, null=True)),
                ('email', models.CharField(max_length=100, null=True)),
                ('avatar', models.CharField(max_length=255, null=True)),
                ('about', models.TextField(null=True)),
                ('created_at', models.DateTimeField(null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('iamges_total_count', models.IntegerField(default=0)),
                ('sequences_total_count', models.IntegerField(default=0)),
                ('updated_at',
                 models.DateTimeField(blank=True,
                                      default=datetime.datetime.now)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('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)),
                ('name', models.CharField(max_length=150)),
                ('phone', models.CharField(max_length=50)),
                ('date_of_birth', models.DateField(blank=True, null=True)),
                ('picture',
                 models.ImageField(blank=True, null=True, upload_to='')),
                ('is_staff', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('last_login', models.DateTimeField(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={
                'abstract': False,
            },
            managers=[
                ('objects', accounts.models.AccountManager()),
            ],
        ),
    ]
コード例 #8
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')),
                ('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')),
                ('title',
                 models.CharField(blank=True,
                                  max_length=60,
                                  null=True,
                                  verbose_name='Officer Position')),
                ('wpibox',
                 models.IntegerField(blank=True,
                                     null=True,
                                     verbose_name='WPI Box Number')),
                ('phone',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='Phone Number')),
                ('carrier',
                 models.CharField(
                     blank=True,
                     choices=[('', 'Opt-out'), ('vtext.com', 'Verizon'),
                              ('txt.att.net', 'AT&T'),
                              ('myboostmobile.com', 'Boost Mobile'),
                              ('mms.cricketwireless.net', 'Cricket'),
                              ('msg.fi.google.com', 'Google Fi'),
                              ('mymetropcs.com', 'Metro PCS'),
                              ('mmst5.tracfone.com', 'Simple Mobile'),
                              ('messaging.sprintpcs.com', 'Sprint'),
                              ('tmomail.net', 'T-Mobile'),
                              ('vmobl.com', 'Virgin Mobile'),
                              ('vmobile.ca', 'Virgin Mobile Canada'),
                              ('vtext.com', 'Xfinity Mobile')],
                     default='',
                     help_text=
                     'By selecting your cellular carrier you consent to receiving text messages from LNL',
                     max_length=25,
                     null=True,
                     verbose_name='Cellular Carrier')),
                ('addr',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Address / Office Location')),
                ('mdc',
                 models.CharField(blank=True,
                                  max_length=32,
                                  null=True,
                                  verbose_name='MDC')),
                ('nickname',
                 models.CharField(blank=True,
                                  max_length=32,
                                  null=True,
                                  verbose_name='Nickname')),
                ('student_id',
                 models.PositiveIntegerField(blank=True,
                                             null=True,
                                             verbose_name='Student ID')),
                ('class_year',
                 models.PositiveIntegerField(blank=True, null=True)),
                ('locked', models.BooleanField(default=False)),
                ('away_exp',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Away Status Expiration')),
                ('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': ('last_name', 'first_name', 'class_year'),
                'permissions':
                (('change_group', 'Change the group membership of a user'),
                 ('edit_mdc', 'Change the MDC of a user'),
                 ('view_member', 'View LNL members')),
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='OfficerImg',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('img',
                 models.ImageField(storage=data.storage.OverwriteStorage(),
                                   upload_to=accounts.models.path_and_rename,
                                   verbose_name='Image')),
                ('officer',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='img',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #9
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('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)),
                ('username',
                 models.CharField(
                     max_length=20,
                     unique=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             re.compile('^[-\\w]+\\Z'),
                             "Enter a valid 'slug' consisting of Unicode letters, numbers, underscores, or hyphens.",
                             'invalid')
                     ])),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('password', models.CharField(max_length=200)),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('gender',
                 models.CharField(choices=[('M', 'Male'), ('F', 'Female')],
                                  max_length=1)),
                ('email_verified', models.BooleanField(default=False)),
                ('bio', models.TextField(max_length=300)),
                ('signup_time', models.DateTimeField(auto_now_add=True)),
                ('login_time', models.DateTimeField(auto_now=True)),
                ('profile_pic',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=accounts.models.gen_profile_pic)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_superuser', 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()),
            ],
        ),
    ]
コード例 #10
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')),
                ('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', accounts.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Member',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.FileField(blank=True,
                                  upload_to='member_profile_images')),
                ('registration_number',
                 models.CharField(max_length=255,
                                  verbose_name='Registration Number')),
                ('middle_name',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Middle Name')),
                ('date_of_birth',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Date of Birth')),
                ('gender',
                 models.CharField(choices=[('Female', 'Female'),
                                           ('Male', 'Male')],
                                  max_length=6,
                                  verbose_name='Gender')),
                ('country_code',
                 models.CharField(choices=[
                     ('Algeria (+213)', 'Algeria (+213)'),
                     ('Andorra (+376)', 'Andorra (+376)'),
                     ('Angola (+244)', 'Angola (+244)'),
                     ('Anguilla (+1264)', 'Anguilla (+1264)'),
                     ('Antigua Barbuda (+1268)', 'Antigua Barbuda (+1268)'),
                     ('Argentina (+54)', 'Argentina (+54)'),
                     ('Armenia (+374)', 'Armenia (+374)'),
                     ('Aruba (+297)', 'Aruba (+297)'),
                     ('Australia (+61)', 'Australia (+61)'),
                     ('Austria (+43)', 'Austria (+43)'),
                     ('Azerbaijan (+994)', 'Azerbaijan (+994)'),
                     ('Bahamas (+1242)', 'Bahamas (+1242)'),
                     ('Bahrain (+973)', 'Bahrain (+973)'),
                     ('Bangladesh (+880)', 'Bangladesh (+880)'),
                     ('Barbados (+1246)', 'Barbados (+1246)'),
                     ('Belarus (+375)', 'Belarus (+375)'),
                     ('Belgium (+32)', 'Belgium (+32)'),
                     ('Belize (+501)', 'Belize (+501)'),
                     ('Benin (+229)', 'Benin (+229)'),
                     ('Bermuda (+1441)', 'Bermuda (+1441)'),
                     ('Bhutan (+975)', 'Bhutan (+975)'),
                     ('Bolivia (+591)', 'Bolivia (+591)'),
                     ('Bosnia Herzegovina (+387)',
                      'Bosnia Herzegovina (+387)'),
                     ('Botswana (+267)', 'Botswana (+267)'),
                     ('Brazil (+55)', 'Brazil (+55)'),
                     ('Brunei (+673)', 'Brunei (+673)'),
                     ('Bulgaria (+359)', 'Bulgaria (+359)'),
                     ('Burkina Faso (+226)', 'Burkina Faso (+226)'),
                     ('Burundi (+257)', 'Burundi (+257)'),
                     ('Cambodia (+855)', 'Cambodia (+855)'),
                     ('Cameroon (+237)', 'Cameroon (+237)'),
                     ('Canada (+1)', 'Canada (+1)'),
                     ('Cape Verde Islands (+238)',
                      'Cape Verde Islands (+238)'),
                     ('Cayman Islands (+1345)', 'Cayman Islands (+1345)'),
                     ('Central African Republic (+236)',
                      'Central African Republic (+236)'),
                     ('Chile (+56)', 'Chile (+56)'),
                     ('China (+86)', 'China (+86)'),
                     ('Colombia (+57)', 'Colombia (+57)'),
                     ('Comoros (+269)', 'Comoros (+269)'),
                     ('Congo (+242)', 'Congo (+242)'),
                     ('Cook Islands (+682)', 'Cook Islands (+682)'),
                     ('Costa Rica (+506)', 'Costa Rica (+506)'),
                     ('Croatia (+385)', 'Croatia (+385)'),
                     ('Cuba (+53)', 'Cuba (+53)'),
                     ('Cyprus - North (+90)', 'Cyprus - North (+90)'),
                     ('Cyprus - South (+357)', 'Cyprus - South (+357)'),
                     ('Czech Republic (+420)', 'Czech Republic (+420)'),
                     ('Denmark (+45)', 'Denmark (+45)'),
                     ('Djibouti (+253)', 'Djibouti (+253)'),
                     ('Dominica (+1809)', 'Dominica (+1809)'),
                     ('Dominican Republic (+1809)',
                      'Dominican Republic (+1809)'),
                     ('Ecuador (+593)', 'Ecuador (+593)'),
                     ('Egypt (+20)', 'Egypt (+20)'),
                     ('El Salvador (+503)', 'El Salvador (+503)'),
                     ('Equatorial Guinea (+240)', 'Equatorial Guinea (+240)'),
                     ('Eritrea (+291)', 'Eritrea (+291)'),
                     ('Estonia (+372)', 'Estonia (+372)'),
                     ('Ethiopia (+251)', 'Ethiopia (+251)'),
                     ('Falkland Islands (+500)', 'Falkland Islands (+500)'),
                     ('Faroe Islands (+298)', 'Faroe Islands (+298)'),
                     ('Fiji (+679)', 'Fiji (+679)'),
                     ('Finland (+358)', 'Finland (+358)'),
                     ('France (+33)', 'France (+33)'),
                     ('French Guiana (+594)', 'French Guiana (+594)'),
                     ('French Polynesia (+689)', 'French Polynesia (+689)'),
                     ('Gabon (+241)', 'Gabon (+241)'),
                     ('Gambia (+220)', 'Gambia (+220)'),
                     ('Georgia (+7880)', 'Georgia (+7880)'),
                     ('Germany (+49)', 'Germany (+49)'),
                     ('Ghana (+233)', 'Ghana (+233)'),
                     ('Gibraltar (+350)', 'Gibraltar (+350)'),
                     ('Greece (+30)', 'Greece (+30)'),
                     ('Greenland (+299)', 'Greenland (+299)'),
                     ('Grenada (+1473)', 'Grenada (+1473)'),
                     ('Guadeloupe (+590)', 'Guadeloupe (+590)'),
                     ('Guam (+671)', 'Guam (+671)'),
                     ('Guatemala (+502)', 'Guatemala (+502)'),
                     ('Guinea (+224)', 'Guinea (+224)'),
                     ('Guinea - Bissau (+245)', 'Guinea - Bissau (+245)'),
                     ('Guyana (+592)', 'Guyana (+592)'),
                     ('Haiti (+509)', 'Haiti (+509)'),
                     ('Honduras (+504)', 'Honduras (+504)'),
                     ('Hong Kong (+852)', 'Hong Kong (+852)'),
                     ('Hungary (+36)', 'Hungary (+36)'),
                     ('Iceland (+354)', 'Iceland (+354)'),
                     ('India (+91)', 'India (+91)'),
                     ('Indonesia (+62)', 'Indonesia (+62)'),
                     ('Iraq (+964)', 'Iraq (+964)'),
                     ('Iran (+98)', 'Iran (+98)'),
                     ('Ireland (+353)', 'Ireland (+353)'),
                     ('Israel (+972)', 'Israel (+972)'),
                     ('Italy (+39)', 'Italy (+39)'),
                     ('Jamaica (+1876)', 'Jamaica (+1876)'),
                     ('Japan (+81)', 'Japan (+81)'),
                     ('Jordan (+962)', 'Jordan (+962)'),
                     ('Kazakhstan (+7)', 'Kazakhstan (+7)'),
                     ('Kenya (+254)', 'Kenya (+254)'),
                     ('Kiribati (+686)', 'Kiribati (+686)'),
                     ('Korea - North (+850)', 'Korea - North (+850)'),
                     ('Korea - South (+82)', 'Korea - South (+82)'),
                     ('Kuwait (+965)', 'Kuwait (+965)'),
                     ('Kyrgyzstan (+996)', 'Kyrgyzstan (+996)'),
                     ('Laos (+856)', 'Laos (+856)'),
                     ('Latvia (+371)', 'Latvia (+371)'),
                     ('Lebanon (+961)', 'Lebanon (+961)'),
                     ('Lesotho (+266)', 'Lesotho (+266)'),
                     ('Liberia (+231)', 'Liberia (+231)'),
                     ('Libya (+218)', 'Libya (+218)'),
                     ('Liechtenstein (+417)', 'Liechtenstein (+417)'),
                     ('Lithuania (+370)', 'Lithuania (+370)'),
                     ('Luxembourg (+352)', 'Luxembourg (+352)'),
                     ('Macao (+853)', 'Macao (+853)'),
                     ('Macedonia (+389)', 'Macedonia (+389)'),
                     ('Madagascar (+261)', 'Madagascar (+261)'),
                     ('Malawi (+265)', 'Malawi (+265)'),
                     ('Malaysia (+60)', 'Malaysia (+60)'),
                     ('Maldives (+960)', 'Maldives (+960)'),
                     ('Mali (+223)', 'Mali (+223)'),
                     ('Malta (+356)', 'Malta (+356)'),
                     ('Marshall Islands (+692)', 'Marshall Islands (+692)'),
                     ('Martinique (+596)', 'Martinique (+596)'),
                     ('Mauritania (+222)', 'Mauritania (+222)'),
                     ('Mayotte (+269)', 'Mayotte (+269)'),
                     ('Mexico (+52)', 'Mexico (+52)'),
                     ('Micronesia (+691)', 'Micronesia (+691)'),
                     ('Moldova (+373)', 'Moldova (+373)'),
                     ('Monaco (+377)', 'Monaco (+377)'),
                     ('Mongolia (+976)', 'Mongolia (+976)'),
                     ('Montserrat (+1664)', 'Montserrat (+1664)'),
                     ('Morocco (+212)', 'Morocco (+212)'),
                     ('Mozambique (+258)', 'Mozambique (+258)'),
                     ('Myanmar (+95)', 'Myanmar (+95)'),
                     ('Namibia (+264)', 'Namibia (+264)'),
                     ('Nauru (+674)', 'Nauru (+674)'),
                     ('Nepal (+977)', 'Nepal (+977)'),
                     ('Netherlands (+31)', 'Netherlands (+31)'),
                     ('New Caledonia (+687)', 'New Caledonia (+687)'),
                     ('New Zealand (+64)', 'New Zealand (+64)'),
                     ('Nicaragua (+505)', 'Nicaragua (+505)'),
                     ('Niger (+227)', 'Niger (+227)'),
                     ('Nigeria (+234)', 'Nigeria (+234)'),
                     ('Niue (+683)', 'Niue (+683)'),
                     ('Norfolk Islands (+672)', 'Norfolk Islands (+672)'),
                     ('Northern Marianas (+670)', 'Northern Marianas (+670)'),
                     ('Norway (+47)', 'Norway (+47)'),
                     ('Oman (+968)', 'Oman (+968)'),
                     ('Pakistan (+92)', 'Pakistan (+92)'),
                     ('Palau (+680)', 'Palau (+680)'),
                     ('Panama (+507)', 'Panama (+507)'),
                     ('Papua New Guinea (+675)', 'Papua New Guinea (+675)'),
                     ('Paraguay (+595)', 'Paraguay (+595)'),
                     ('Peru (+51)', 'Peru (+51)'),
                     ('Philippines (+63)', 'Philippines (+63)'),
                     ('Poland (+48)', 'Poland (+48)'),
                     ('Portugal (+351)', 'Portugal (+351)'),
                     ('Puerto Rico (+1787)', 'Puerto Rico (+1787)'),
                     ('Qatar (+974)', 'Qatar (+974)'),
                     ('Reunion (+262)', 'Reunion (+262)'),
                     ('Romania (+40)', 'Romania (+40)'),
                     ('Russia (+7)', 'Russia (+7)'),
                     ('Rwanda (+250)', 'Rwanda (+250)'),
                     ('San Marino (+378)', 'San Marino (+378)'),
                     ('Sao Tome Principe (+239)', 'Sao Tome Principe (+239)'),
                     ('Saudi Arabia (+966)', 'Saudi Arabia (+966)'),
                     ('Senegal (+221)', 'Senegal (+221)'),
                     ('Serbia (+381)', 'Serbia (+381)'),
                     ('Seychelles (+248)', 'Seychelles (+248)'),
                     ('Sierra Leone (+232)', 'Sierra Leone (+232)'),
                     ('Singapore (+65)', 'Singapore (+65)'),
                     ('Slovak Republic (+421)', 'Slovak Republic (+421)'),
                     ('Slovenia (+386)', 'Slovenia (+386)'),
                     ('Solomon Islands (+677)', 'Solomon Islands (+677)'),
                     ('Somalia (+252)', 'Somalia (+252)'),
                     ('South Africa (+27)', 'South Africa (+27)'),
                     ('Spain (+34)', 'Spain (+34)'),
                     ('Sri Lanka (+94)', 'Sri Lanka (+94)'),
                     ('St. Helena (+290)', 'St. Helena (+290)'),
                     ('St. Kitts (+1869)', 'St. Kitts (+1869)'),
                     ('St. Lucia (+1758)', 'St. Lucia (+1758)'),
                     ('Suriname (+597)', 'Suriname (+597)'),
                     ('Sudan (+249)', 'Sudan (+249)'),
                     ('Swaziland (+268)', 'Swaziland (+268)'),
                     ('Sweden (+46)', 'Sweden (+46)'),
                     ('Switzerland (+41)', 'Switzerland (+41)'),
                     ('Syria (+963)', 'Syria (+963)'),
                     ('Taiwan (+886)', 'Taiwan (+886)'),
                     ('Tajikistan (+992)', 'Tajikistan (+992)'),
                     ('Thailand (+66)', 'Thailand (+66)'),
                     ('Togo (+228)', 'Togo (+228)'),
                     ('Tonga (+676)', 'Tonga (+676)'),
                     ('Trinidad Tobago (+1868)', 'Trinidad Tobago (+1868)'),
                     ('Tunisia (+216)', 'Tunisia (+216)'),
                     ('Turkey (+90)', 'Turkey (+90)'),
                     ('Turkmenistan (+993)', 'Turkmenistan (+993)'),
                     ('Turks Caicos Islands (+1649)',
                      'Turks Caicos Islands (+1649)'),
                     ('Tuvalu (+688)', 'Tuvalu (+688)'),
                     ('Uganda (+256)', 'Uganda (+256)'),
                     ('UK (+44)', 'UK (+44)'),
                     ('Ukraine (+380)', 'Ukraine (+380)'),
                     ('United Arab Emirates (+971)',
                      'United Arab Emirates (+971)'),
                     ('Uruguay (+598)', 'Uruguay (+598)'),
                     ('USA (+1)', 'USA (+1)'),
                     ('Uzbekistan (+998)', 'Uzbekistan (+998)'),
                     ('Vanuatu (+678)', 'Vanuatu (+678)'),
                     ('Vatican City (+379)', 'Vatican City (+379)'),
                     ('Venezuela (+58)', 'Venezuela (+58)'),
                     ('Vietnam (+84)', 'Vietnam (+84)'),
                     ('Virgin Islands - British (+1)',
                      'Virgin Islands - British (+1)'),
                     ('Virgin Islands - US (+1)', 'Virgin Islands - US (+1)'),
                     ('Wallis Futuna (+681)', 'Wallis Futuna (+681)'),
                     ('Yemen (North)(+969)', 'Yemen (North)(+969)'),
                     ('Yemen (South)(+967)', 'Yemen (South)(+967)'),
                     ('Zambia (+260)', 'Zambia (+260)'),
                     ('Zimbabwe (+263)', 'Zimbabwe (+263)')
                 ],
                                  default='Kenya (+254)',
                                  max_length=100,
                                  verbose_name='Country Code')),
                ('phone_number',
                 models.PositiveIntegerField(verbose_name='Phone Number')),
                ('baptised',
                 models.CharField(choices=[('No', 'No'), ('Yes', 'Yes')],
                                  default='No',
                                  max_length=3,
                                  verbose_name='Baptised')),
                ('confirmed',
                 models.CharField(choices=[('No', 'No'), ('Yes', 'Yes'),
                                           ('Not Applicable', 'Not Applicable')
                                           ],
                                  default='No',
                                  max_length=15,
                                  verbose_name='Comfirmed Member')),
                ('communicant',
                 models.CharField(choices=[('No', 'No'), ('Yes', 'Yes'),
                                           ('Not Applicable', 'Not Applicable')
                                           ],
                                  default='No',
                                  max_length=15,
                                  verbose_name='Communicant')),
                ('educational_level',
                 models.CharField(choices=[('None', 'None'),
                                           ('Pre-Primary', 'Pre-Primary'),
                                           ('Primary', 'Primary'),
                                           ('Secondary', 'Secondary'),
                                           ('Vocational', 'Vocational'),
                                           ('Tertiary', 'Tertiary'),
                                           ('University', 'University')],
                                  default='None',
                                  max_length=15,
                                  verbose_name='Educational Level')),
                ('marital_status',
                 models.CharField(choices=[('Single', 'Single'),
                                           ('Married', 'Married'),
                                           ('Divorced', 'Divorced'),
                                           ('Separated', 'Separated')],
                                  default='Single',
                                  max_length=15,
                                  verbose_name='Marital Status')),
                ('source_of_income',
                 models.CharField(choices=[('Salaried', 'Salaried'),
                                           ('Unemployed', 'Unmeployed'),
                                           ('Self Employed', 'Self Employed')],
                                  default='Unmeployed',
                                  max_length=15,
                                  verbose_name='Source Of Income')),
                ('parish_of_origin',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Parish of Origin')),
                ('church_of_origin',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Church of Origin')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Member',
                'verbose_name_plural': 'Members',
            },
        ),
    ]
コード例 #11
0
ファイル: 0001_initial.py プロジェクト: Jesuisjavert/LoveLine
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')),
                ('email',
                 models.EmailField(max_length=255,
                                   unique=True,
                                   verbose_name='이메일')),
                ('nickname', models.CharField(max_length=15, unique=True)),
                ('gender',
                 models.CharField(max_length=2, null=True, verbose_name='성별')),
                ('age', models.IntegerField(null=True, verbose_name='나이')),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_superuser', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('date_joind', 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')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to=accounts.models.user_image_path)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='userprofile',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #12
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')),
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  help_text='The UUID to identify a user.',
                                  primary_key=True,
                                  serialize=False)),
                ('email',
                 models.EmailField(max_length=254,
                                   null=True,
                                   unique=True,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user is part of the site staff',
                     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')),
                ('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,
            },
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('short_name',
                 models.CharField(
                     blank=True,
                     help_text='The name the user would like to be called.',
                     max_length=30,
                     verbose_name='short name')),
                ('full_name',
                 models.CharField(
                     blank=True,
                     help_text=
                     "Stores a user's full name. Useful due to significant variations in local naming schemes.",
                     max_length=150,
                     verbose_name='full name')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      help_text='The date when a user joined.',
                                      verbose_name='date joined')),
            ],
        ),
    ]
コード例 #13
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterModelOptions(
            name='user',
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users'
            },
        ),
        migrations.AlterModelManagers(
            name='user',
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
        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=150,
                                   verbose_name='last name'),
        ),
        migrations.AddField(
            model_name='user',
            name='password',
            field=models.CharField(default='Unknown',
                                   max_length=128,
                                   verbose_name='password'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='user',
            name='sex',
            field=models.CharField(choices=[('f', 'female'), ('m', 'male')],
                                   default='Unknown',
                                   max_length=1),
            preserve_default=False,
        ),
        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='user',
            name='username',
            field=models.CharField(
                default='Unknown',
                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'),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='UserSession',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('session_key', models.CharField(editable=False,
                                                 max_length=40)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('user',
                 models.ForeignKey(editable=False,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bio', models.TextField(blank=True)),
                ('website_url', models.URLField(blank=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #14
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.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('username',
                 models.CharField(default=None,
                                  max_length=20,
                                  unique=True,
                                  verbose_name='Username')),
                ('first_name',
                 models.CharField(max_length=50, verbose_name='First Name')),
                ('last_name',
                 models.CharField(max_length=50, verbose_name='Last Name')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='Email adress')),
                ('confirmed_email',
                 models.BooleanField(default=False,
                                     verbose_name='Confirmed email')),
                ('avatar',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=accounts.models.upload_path_handler_avatar,
                     verbose_name='avatar')),
                ('is_staff',
                 models.BooleanField(default=False,
                                     verbose_name='Staff status')),
                ('is_superuser',
                 models.BooleanField(default=False,
                                     verbose_name='Superuser status')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='Active')),
                ('date_joined',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Date joined')),
                ('date_updated',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Date updated')),
                ('activation_key',
                 models.UUIDField(default=uuid.uuid4,
                                  unique=True,
                                  verbose_name='Activation key')),
                ('facebook_id',
                 models.BigIntegerField(default=None,
                                        null=True,
                                        unique=True,
                                        verbose_name='Facebook ID')),
                ('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,
            },
        ),
    ]
コード例 #15
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        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')),
                ('username', models.CharField(max_length=50, unique=True)),
                ('email',
                 models.EmailField(
                     max_length=254,
                     unique=True,
                     validators=[django.core.validators.EmailValidator()])),
                ('first_name', models.CharField(max_length=100)),
                ('last_name', models.CharField(max_length=100)),
                ('dob',
                 accounts.fields.DatePickerField(
                     verbose_name='Date of birth')),
                ('bio', ckeditor.fields.RichTextField()),
                ('avatar',
                 models.ImageField(upload_to=accounts.models.image_path,
                                   verbose_name='User avatar')),
                ('favorite_animal', models.CharField(blank=True,
                                                     max_length=50)),
                ('hobbies', models.CharField(blank=True, max_length=100)),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_superuser', 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={
                'abstract': False,
            },
        ),
    ]
コード例 #16
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        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')),
                ('email',
                 models.EmailField(max_length=255,
                                   unique=True,
                                   verbose_name='Email ID')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='Active')),
                ('is_doctor',
                 models.BooleanField(default=False,
                                     verbose_name='User is Doctor')),
                ('is_patient',
                 models.BooleanField(default=False,
                                     verbose_name='User is Patient')),
                ('is_staff', models.BooleanField(default=False)),
                ('is_admin',
                 models.BooleanField(default=False,
                                     verbose_name='User is Admin')),
                ('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,
            },
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deviceid',
                 models.CharField(
                     help_text='Enter the Bluetooth pin of the devce.',
                     max_length=7,
                     unique=True,
                     verbose_name='Device ID')),
                ('year_of_manufacture',
                 models.DateField(max_length=8,
                                  verbose_name='Manufacturing Year')),
            ],
            options={
                'ordering': ['year_of_manufacture', 'patient'],
            },
        ),
        migrations.CreateModel(
            name='Doctor',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=250,
                                  verbose_name='First Name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=250,
                                  verbose_name='Last Name')),
                ('mobileno',
                 models.CharField(
                     max_length=10,
                     validators=[
                         django.core.validators.RegexValidator(
                             message='Enter valid 10 digits mobile number',
                             regex='\\d{10}')
                     ],
                     verbose_name='Mobile Number')),
                ('date_of_birth',
                 models.DateField(max_length=8, verbose_name='Date of Birth')),
                ('age', models.IntegerField(verbose_name='Age')),
                ('gender',
                 models.CharField(blank=True,
                                  choices=[('M', 'Male'), ('F', 'Female'),
                                           ('T', 'Transgender')],
                                  help_text='Please select your gender.',
                                  max_length=1,
                                  verbose_name='Gender')),
                ('speciality',
                 models.CharField(max_length=250, verbose_name='Speciality')),
                ('years_of_experience',
                 models.IntegerField(verbose_name='Years of Experience')),
                ('city', models.CharField(max_length=200,
                                          verbose_name='City')),
                ('patient_count',
                 models.IntegerField(
                     default=0, verbose_name='Count of Patients assigned')),
                ('image',
                 models.ImageField(
                     blank=True,
                     upload_to='Profile Image/doctor_profile_image/')),
                ('doctor_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['years_of_experience', 'doctor_id'],
            },
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=250,
                                  verbose_name='First Name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=250,
                                  verbose_name='Last Name')),
                ('patient_pin',
                 models.CharField(max_length=7,
                                  null=True,
                                  verbose_name='Patient Device Pin')),
                ('mobileno',
                 models.CharField(
                     max_length=10,
                     validators=[
                         django.core.validators.RegexValidator(
                             message='Enter valid 10 digits mobile number',
                             regex='\\d{10}')
                     ],
                     verbose_name='Mobile Number')),
                ('date_of_birth',
                 models.DateField(max_length=8, verbose_name='Date of Birth')),
                ('age', models.IntegerField(verbose_name='Age')),
                ('gender',
                 models.CharField(blank=True,
                                  choices=[('M', 'Male'), ('F', 'Female'),
                                           ('T', 'Transgender')],
                                  help_text='Please select your gender.',
                                  max_length=1,
                                  verbose_name='Gender')),
                ('city', models.CharField(max_length=100,
                                          verbose_name='City')),
                ('doc_assigned',
                 models.BooleanField(default=False,
                                     verbose_name='Doctor Assigned')),
                ('image',
                 models.ImageField(
                     blank=True,
                     upload_to='Profile Image/patient_profile_image')),
                ('doctor',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   to='accounts.Doctor')),
                ('patient_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['date_of_birth'],
            },
        ),
        migrations.CreateModel(
            name='Readings',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('blood_pressure',
                 models.CharField(max_length=3,
                                  verbose_name='Blood Pressure')),
                ('heart_beat',
                 models.CharField(max_length=3,
                                  verbose_name='HeartBeats per Minute')),
                ('SpO2',
                 models.CharField(max_length=6, verbose_name='SpO2 value')),
                ('body_temparature',
                 models.CharField(max_length=3,
                                  verbose_name='Body Temperature')),
                ('date_time',
                 models.DateTimeField(verbose_name='Date & Time')),
                ('patient_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='accounts.Patient')),
            ],
            options={
                'ordering': ['date_time', 'patient_id'],
            },
        ),
        migrations.CreateModel(
            name='Relative',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name',
                 models.CharField(max_length=250, verbose_name='First Name')),
                ('last_name',
                 models.CharField(max_length=250, verbose_name='Last Name')),
                ('gender',
                 models.CharField(blank=True,
                                  choices=[('M', 'Male'), ('F', 'Female'),
                                           ('T', 'Transgender')],
                                  help_text='Please select your gender.',
                                  max_length=1,
                                  verbose_name='Gender')),
                ('age', models.IntegerField(null=True, verbose_name='Age')),
                ('mobileno',
                 models.CharField(
                     max_length=10,
                     validators=[
                         django.core.validators.RegexValidator(
                             message='Enter valid 10 digits mobile number',
                             regex='\\d{10}')
                     ],
                     verbose_name='Mobile Number')),
                ('relation_to_user',
                 models.CharField(max_length=150,
                                  verbose_name='Relation with User')),
                ('patient_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Patient')),
            ],
            options={
                'ordering': ['patient_id', 'first_name', 'relation_to_user'],
            },
        ),
        migrations.AddField(
            model_name='device',
            name='patient',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to='accounts.Patient'),
        ),
    ]
コード例 #17
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('banks', '0001_initial'),
        ('company', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Borrower',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=300, null=True)),
                ('last_name', models.CharField(blank=True, max_length=300, null=True)),
                ('photo', cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True, verbose_name=accounts.models.upload_image_path)),
                ('gender', models.CharField(blank=True, choices=[('Male', 'Male'), ('Female', 'Female')], max_length=20, null=True)),
                ('address', models.CharField(blank=True, help_text='Block 32, Arizona Street', max_length=300, null=True)),
                ('lga', models.CharField(blank=True, max_length=300, null=True)),
                ('state', models.CharField(blank=True, choices=[('Lagos', 'Lagos'), ('Kano', 'Kano'), ('Enugu', 'Enugu')], help_text='Province/State', max_length=300, null=True)),
                ('country', django_countries.fields.CountryField(blank=True, max_length=2, null=True)),
                ('title', models.CharField(blank=True, max_length=300, null=True)),
                ('phone', phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, null=True, region=None)),
                ('land_line', phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, null=True, region=None)),
                ('business_name', models.CharField(blank=True, max_length=300, null=True)),
                ('working_status', models.CharField(blank=True, choices=[('Employed', 'Employed'), ('Unemployed', 'Unemployed'), ('Self-Employed', 'Self-Employed')], max_length=300, null=True)),
                ('email', models.EmailField(blank=True, max_length=254, null=True)),
                ('unique_identifier', models.CharField(blank=True, help_text='Social Security Number, License Or Registration ID', max_length=300, null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('account_number', models.CharField(blank=True, max_length=11, null=True)),
                ('bvn', models.CharField(blank=True, help_text='Bank Verification Number', max_length=300, null=True)),
                ('date_of_birth', models.DateField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated', models.DateTimeField(auto_now=True, null=True)),
                ('bank', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='banks.BankCode')),
                ('registered_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
            ],
            options={
                'unique_together': {('slug', 'phone', 'email')},
            },
        ),
        migrations.CreateModel(
            name='BorrowerGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=300, null=True)),
                ('meeting_schedule', models.DateTimeField(blank=True, null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('description', models.TextField()),
                ('timestamp', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated', models.DateTimeField(auto_now=True, null=True)),
                ('borrowers', models.ManyToManyField(related_name='members', to='borrowers.Borrower')),
                ('collector', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='borrowers.Borrower')),
                ('group_leader', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group_leader', to='borrowers.Borrower')),
                ('registered_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
            ],
            options={
                'unique_together': {('slug', 'name')},
            },
        ),
    ]
コード例 #18
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_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')),
                ('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(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')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 20 characters or fewer. Letters, digits and _ only.',
                     max_length=20,
                     primary_key=True,
                     serialize=False,
                     unique=True,
                     validators=[core.validators.UsernameValidator()],
                     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')),
                ('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': ['-date_joined'],
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
                ('public_objects', accounts.models.PublicUserManager()),
            ],
        ),
        migrations.CreateModel(
            name='HistoricalUser',
            fields=[
                ('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(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')),
                ('username',
                 models.CharField(
                     db_index=True,
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 20 characters or fewer. Letters, digits and _ only.',
                     max_length=20,
                     validators=[core.validators.UsernameValidator()],
                     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')),
                ('history_id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical user',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalGroup',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=150,
                                  verbose_name='name')),
                ('history_id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical group',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
コード例 #19
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255, verbose_name='department')),
            ],
            options={
                'verbose_name': '部署名/Deprtment',
                'verbose_name_plural': '部署名/Deprtment',
            },
        ),
        migrations.CreateModel(
            name='Factory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  verbose_name='factory name')),
            ],
            options={
                'verbose_name': '工場名/Factory Name',
                'verbose_name_plural': '工場名/Factory Name',
            },
        ),
        migrations.CreateModel(
            name='OfficialPosition',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  verbose_name='official position')),
            ],
            options={
                'verbose_name': '役職/Official Position',
                'verbose_name_plural': '役職/Official Position',
            },
        ),
        migrations.CreateModel(
            name='PhoneNumber',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('_number',
                 models.CharField(blank=True,
                                  max_length=50,
                                  verbose_name='phone number')),
            ],
            options={
                'verbose_name': '電話番号/Phone Number',
                'verbose_name_plural': '電話番号/Phone Number',
            },
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=255,
                                  verbose_name='company name')),
                ('department',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Department')),
                ('factoryname',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Factory')),
                ('officialposition',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.OfficialPosition')),
                ('phonenumber',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.PhoneNumber')),
            ],
            options={
                'verbose_name': '会社名/Company Name',
                'verbose_name_plural': '会社名/Company Name',
            },
        ),
        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(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('membershiplicense',
                 models.BooleanField(
                     default=False,
                     verbose_name='メインライセンス/Membership License')),
                ('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')),
                ('company',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Company',
                                   verbose_name='会社名/Company 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',
            },
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
    ]
コード例 #20
0
ファイル: 0001_initial.py プロジェクト: Anton6896/Cv_site
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        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')),
                ('image',
                 models.ImageField(
                     default='default.jpg',
                     upload_to=accounts.models.customer_image_file_path)),
                ('building_community_name',
                 models.CharField(default='no_name_', max_length=200)),
                ('full_address',
                 models.CharField(default='no_address_', max_length=255)),
                ('is_voted', models.BooleanField(default=False)),
                ('apartment', models.IntegerField(default=0)),
                ('role',
                 models.CharField(blank=True,
                                  choices=[('tenant', 'tenant'),
                                           ('committee', 'committee')],
                                  max_length=20,
                                  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': 'costum_user',
                'verbose_name_plural': 'costum_users',
                'db_table': 'CostumUser',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
コード例 #21
0
ファイル: 0001_initial.py プロジェクト: gelos12/TripTeller
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')),
                ('email',
                 models.CharField(max_length=30,
                                  unique=True,
                                  verbose_name='email')),
                ('nickname',
                 models.CharField(max_length=30,
                                  unique=True,
                                  verbose_name='nickname')),
                ('photo',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='account/%Y/%m/%d',
                                   verbose_name='profil photo')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='Date joined')),
                ('last_login',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='last login')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='active')),
                ('is_staff', models.BooleanField(default=False)),
                ('is_superuser', 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',
                'ordering': ('-date_joined', ),
            },
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
    ]
コード例 #22
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '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')),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('first_name',
                 models.CharField(max_length=60,
                                  null=True,
                                  verbose_name='Fornavn')),
                ('last_name',
                 models.CharField(max_length=150,
                                  null=True,
                                  verbose_name='Etternavn')),
                ('nickname',
                 models.CharField(max_length=150,
                                  null=True,
                                  verbose_name='Kallenavn')),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_superuser', models.BooleanField(default=False)),
                ('date_joined',
                 models.DateTimeField(blank=True,
                                      default=django.utils.timezone.now,
                                      editable=False,
                                      verbose_name='Opprettet')),
                ('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': ['email'],
            },
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
    ]
コード例 #23
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        # ('auth', '0007_alter_validators_add_error_messages'),
        ('auth', '0006_require_contenttypes_0002'),
    ]

    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. 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')),
                ('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', accounts.models.AccountUserManager()),
            ],
        ),
    ]
コード例 #24
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email')),
                ('username',
                 models.CharField(max_length=45,
                                  unique=True,
                                  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')),
                ('date_joined',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date joined')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='active')),
                ('avatar',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=accounts.models.path_and_rename)),
                ('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', accounts.managers.UserManager()),
            ],
        ),
    ]
コード例 #25
0
ファイル: 0001_initial.py プロジェクト: aminhp93/crane_game_2
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('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.CharField(max_length=255, unique=True)),
                ('password', models.CharField(max_length=255)),
                ('first_name', models.CharField(max_length=128)),
                ('last_name', models.CharField(max_length=128)),
                ('postal_code',
                 models.CharField(blank=True, max_length=8, null=True)),
                ('country_id', models.IntegerField(blank=True, null=True)),
                ('address',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('phone_number',
                 models.CharField(blank=True, max_length=11, null=True)),
                ('birthday', models.DateField(auto_now=True, null=True)),
                ('gender', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(auto_now=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={
                'abstract': False,
            },
            managers=[
                ('objects', accounts.models.ProfileManager()),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nick_name',
                 models.CharField(blank=True, max_length=128, null=True)),
                ('posessing_points', models.IntegerField(default=1)),
                ('posessing_tickets', models.IntegerField(default=1)),
                ('rank', models.IntegerField(blank=True, null=True)),
                ('is_mail_magazine', models.BooleanField(default=False)),
                ('is_confirmed_by_phone', models.BooleanField(default=False)),
                ('registered_at', models.DateTimeField(auto_now_add=True)),
                ('last_updated_at', models.DateTimeField(auto_now=True)),
                ('withdrawed_at', models.DateTimeField(auto_now_add=True)),
                ('signup_at', models.DateTimeField(auto_now_add=True)),
                ('is_withdrawed', models.BooleanField(default=False)),
                ('platform_id', models.IntegerField(default=1)),
                ('is_first_time_browser_benefit',
                 models.BooleanField(default=False)),
                ('is_first_tiem_app_benefit',
                 models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('profile',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #26
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BasicUser',
            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)),
                ('is_active', models.BooleanField(default=False)),
                ('is_director', models.BooleanField(default=False)),
                ('is_manager', models.BooleanField(default=False)),
                ('first_name', models.CharField(max_length=255)),
                ('last_name', models.CharField(max_length=255)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('phone', models.CharField(max_length=31, unique=True)),
                ('date_of_birth', models.DateTimeField(blank=True, null=True)),
                ('about', models.TextField(blank=True, max_length=500)),
                ('avatar',
                 models.ImageField(
                     default='default.png',
                     upload_to=accounts.models.user_directory_path)),
                ('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,
            },
        ),
    ]
コード例 #27
0
ファイル: 0001_initial.py プロジェクト: candy12t/Movieee
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')),
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('user_name',
                 models.CharField(
                     help_text=
                     'Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=30,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('email',
                 models.EmailField(help_text='Required.',
                                   max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('icon', models.ImageField(blank=True, upload_to='icon')),
                ('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',
            },
            managers=[
                ('objects', accounts.models.CustomUserManager()),
            ],
        ),
    ]
コード例 #28
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        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')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='メールアドレス')),
                ('account_type',
                 models.IntegerField(choices=[(1, 'ユーザー'), (2, 'スタッフ')],
                                     default=1,
                                     verbose_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')),
                ('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', accounts.models.UserManager()),
            ],
        ),
    ]
コード例 #29
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')),
                ('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')),
                ('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', accounts.models.UserManager()),
            ],
        ),
    ]
コード例 #30
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')),
                ('email',
                 models.EmailField(default='',
                                   max_length=128,
                                   unique=True,
                                   verbose_name='Адрес электронной почты')),
                ('status',
                 models.SmallIntegerField(default=4, verbose_name='Статус')),
                ('last_name',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=128,
                                  verbose_name='Фамилия')),
                ('first_name',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=128,
                                  verbose_name='Имя')),
                ('patronymic',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=128,
                                  verbose_name='Отчество')),
                ('is_staff',
                 models.BooleanField(default=False,
                                     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', accounts.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('main',
                 models.BooleanField(default=True, verbose_name='Основной')),
                ('country',
                 models.CharField(default='',
                                  max_length=32,
                                  verbose_name='Страна')),
                ('region',
                 models.CharField(default='',
                                  max_length=128,
                                  verbose_name='Регион')),
                ('locality',
                 models.CharField(default='',
                                  max_length=64,
                                  verbose_name='Населенный пункт')),
                ('street',
                 models.CharField(default='',
                                  max_length=256,
                                  verbose_name='Улица')),
                ('building',
                 models.CharField(default='',
                                  max_length=32,
                                  verbose_name='Дом, строение, корпус')),
                ('apartment',
                 models.CharField(blank=True,
                                  max_length=8,
                                  null=True,
                                  verbose_name='Квартира, комната')),
                ('zipcode',
                 models.CharField(default='',
                                  max_length=8,
                                  verbose_name='Почтовый индекс')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Пользователь')),
            ],
        ),
    ]