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

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('created',
                 models.DateTimeField(
                     auto_now_add=True,
                     help_text='Date time on which the object was created.',
                     verbose_name='created_at')),
                ('modified',
                 models.DateTimeField(
                     auto_now=True,
                     help_text=
                     'Date time on which the object was last modified.',
                     verbose_name='modified_at')),
                ('email',
                 models.EmailField(error_messages={
                     'unique':
                     'A user with that email already exists.'
                 },
                                   max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('phone_number',
                 models.CharField(
                     blank=True,
                     max_length=17,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             'Phone number must be entered in the format: +999999999. Up to 15 digits allowed.',
                             regex='\\+?1?\\d{9,15}$')
                     ])),
                ('is_client',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Help easily distinguish users and perform queries. Clients are the main type of user.',
                     verbose_name='client')),
                ('is_verified',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Set to true when the user have verified its email address.',
                     verbose_name='verified')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'ordering': ['-created', '-modified'],
                'get_latest_by': 'created',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 models.DateTimeField(
                     auto_now_add=True,
                     help_text='Date time on which the object was created.',
                     verbose_name='created_at')),
                ('modified',
                 models.DateTimeField(
                     auto_now=True,
                     help_text=
                     'Date time on which the object was last modified.',
                     verbose_name='modified_at')),
                ('picture',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='users/pictures/',
                                   verbose_name='profile picture')),
                ('biography', models.TextField(blank=True, max_length=500)),
                ('rides_taken', models.PositiveIntegerField(default=0)),
                ('rides_offered', models.PositiveIntegerField(default=0)),
                ('reputation',
                 models.FloatField(
                     default=5.0,
                     help_text=
                     "User's reputaton based on the rides taken and offered.")
                 ),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created', '-modified'],
                'get_latest_by': 'created',
                'abstract': False,
            },
        ),
    ]
Example #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='MyUser',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username', models.CharField(max_length=30, unique=True)),
                ('first_name', models.CharField(blank=True, max_length=30)),
                ('last_name', models.CharField(blank=True, max_length=30)),
                ('email', models.EmailField(max_length=254)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('date_joined', models.DateTimeField(auto_now=True)),
                ('phone_number', models.CharField(blank=True, max_length=11)),
                ('role',
                 models.IntegerField(choices=[(1, 'super admin'),
                                              (2, 'artist'), (3, 'client')],
                                     default=3)),
                ('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': 'Пользователи',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('bio', models.TextField(blank=True, max_length=500)),
                ('location', models.CharField(blank=True, max_length=30)),
                ('birth_date', models.DateField(blank=True, null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Профиль',
                'verbose_name_plural': 'Профили',
            },
        ),
    ]
Example #3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('is_student', models.BooleanField(default=False)),
                ('is_teacher', models.BooleanField(default=False)),
                ('username', models.CharField(blank=True, max_length=50, null=True)),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=100, unique=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to='')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Choice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('choice_text', models.CharField(max_length=100)),
                ('answer', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course_name', models.CharField(max_length=100)),
                ('course_code', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Notice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('published_date', models.DateTimeField(auto_now_add=True)),
                ('start_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('end_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'ordering': ['-published_date'],
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question_name', models.CharField(max_length=200)),
                ('notice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Notice')),
            ],
        ),
        migrations.CreateModel(
            name='Result',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('class_roll', models.IntegerField(default=0)),
                ('exam_roll', models.IntegerField(default=0)),
                ('total', models.IntegerField(default=0)),
                ('ac', models.IntegerField(default=0)),
                ('wrong', models.IntegerField(default=0)),
                ('marks', models.IntegerField(default=0)),
                ('notice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Notice')),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='student', serialize=False, to=settings.AUTH_USER_MODEL)),
                ('class_roll', models.IntegerField(default=1)),
                ('exam_roll', models.IntegerField(default=123456)),
                ('registration_no', models.IntegerField(default=12345, unique=True)),
                ('batch', models.IntegerField(default=23)),
                ('year', models.CharField(choices=[('11', '1st Year 1st Semester'), ('12', '1st Year 2nd Semester'), ('21', '2nd Year 1st Semester'), ('22', '2nd Year 2nd Semester'), ('31', '3rd Year 1st Semester'), ('32', '3rd Year 2nd Semester'), ('41', '4th Year 1st Semester'), ('42', '4th Year 2nd Semester'), ('51', 'Masters 1st Semester'), ('52', 'Masters 2nd Semester')], default='11', max_length=50)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('accounts.user', models.Model),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='teacher', serialize=False, to=settings.AUTH_USER_MODEL)),
                ('courses', models.ManyToManyField(related_name='Course', to='accounts.Course')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('accounts.user', models.Model),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='choice',
            name='question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Question'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
        migrations.AddField(
            model_name='student',
            name='course_teacher',
            field=models.ManyToManyField(related_name='Course_Teacher', to='accounts.Teacher'),
        ),
        migrations.AddField(
            model_name='notice',
            name='teacher',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Teacher'),
        ),
    ]
Example #4
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')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('user_type', models.CharField(choices=[(1, 'HOD'), (2, 'Staff'), (3, 'Student')], default=1, max_length=10)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Attendance',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('attendance_date', models.DateTimeField(auto_now_add=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Courses',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('course_name', models.CharField(max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='SessionYearModel',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('session_start_year', models.DateField()),
                ('session_end_year', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='Subjects',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('subject_name', models.CharField(max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('course_id', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Courses')),
                ('staff_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Students',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('gender', models.CharField(max_length=100)),
                ('profil_pic', models.FileField(upload_to='')),
                ('address', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('admin', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Courses')),
                ('session_year_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.SessionYearModel')),
            ],
        ),
        migrations.CreateModel(
            name='Staffs',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('address', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('admin', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='NotificationStudent',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('message', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Students')),
            ],
        ),
        migrations.CreateModel(
            name='NotificationStaffs',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('message', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('staff_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Staffs')),
            ],
        ),
        migrations.CreateModel(
            name='LeaveReportStudent',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('leave_date', models.CharField(max_length=100)),
                ('leave_message', models.TextField()),
                ('leave_status', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Students')),
            ],
        ),
        migrations.CreateModel(
            name='LeaveReportStaff',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('leave_date', models.CharField(max_length=100)),
                ('leave_message', models.TextField()),
                ('leave_status', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('staff_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Staffs')),
            ],
        ),
        migrations.CreateModel(
            name='FeedBackStudent',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('feedback', models.CharField(max_length=100)),
                ('feedback_reply', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Students')),
            ],
        ),
        migrations.CreateModel(
            name='FeedBackStaffs',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('feedback', models.CharField(max_length=100)),
                ('feedback_reply', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('staff_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Staffs')),
            ],
        ),
        migrations.CreateModel(
            name='AttendanceReport',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('status', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('attendance_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.Attendance')),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='student_management_app.Students')),
            ],
        ),
        migrations.AddField(
            model_name='attendance',
            name='session_year_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='student_management_app.SessionYearModel'),
        ),
        migrations.AddField(
            model_name='attendance',
            name='subject_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='student_management_app.Subjects'),
        ),
        migrations.CreateModel(
            name='AdminHOD',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now_add=True)),
                ('admin', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Example #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserInfo',
            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')),
                ('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')),
                ('username', models.CharField(max_length=64, unique=True, verbose_name='\u7528\u6237\u540d')),
                ('email', models.EmailField(blank=True, max_length=255, null=True, unique=True, verbose_name='email address')),
                ('uid', models.CharField(max_length=64, unique=True)),
                ('mobile', models.BigIntegerField(help_text='\u7528\u4e8e\u624b\u673a\u9a8c\u8bc1\u7801\u767b\u5f55', null=True, unique=True, verbose_name='\u624b\u673a')),
                ('qq', models.CharField(blank=True, db_index=True, max_length=64, null=True, verbose_name='QQ')),
                ('weixin', models.CharField(blank=True, db_index=True, max_length=128, null=True, verbose_name='\u5fae\u4fe1')),
                ('signature', models.CharField(blank=True, max_length=255, null=True, verbose_name='\u4e2a\u4eba\u7b7e\u540d')),
                ('brief', models.TextField(blank=True, null=True, verbose_name='\u4e2a\u4eba\u4ecb\u7ecd')),
                ('openid', models.CharField(blank=True, max_length=128, null=True)),
                ('alipay_card', models.CharField(blank=True, max_length=128, null=True, verbose_name='\u652f\u4ed8\u5b9d\u8d26\u6237')),
                ('gender', models.SmallIntegerField(choices=[(0, '\u4fdd\u5bc6'), (1, '\u7537'), (2, '\u5973')], default=0, verbose_name='\u6027\u522b')),
                ('id_card', models.CharField(blank=True, max_length=32, null=True, verbose_name='\u8eab\u4efd\u8bc1\u53f7\u6216\u62a4\u7167\u53f7')),
                ('password', models.CharField(help_text="<a class='btn-link' href='password'>\u91cd\u7f6e\u5bc6\u7801</a>", max_length=128, verbose_name='password')),
                ('is_active', models.BooleanField(default=True, verbose_name='\u8d26\u6237\u72b6\u6001')),
                ('is_staff', models.BooleanField(default=False, help_text='\u51b3\u5b9a\u7740\u7528\u6237\u662f\u5426\u53ef\u767b\u5f55\u7ba1\u7406\u540e\u53f0', verbose_name='staff status')),
                ('name', models.CharField(default='', max_length=32, verbose_name='\u771f\u5b9e\u59d3\u540d')),
                ('head_img', models.CharField(default='/static/frontend/head_portrait/[email protected]', max_length=256, verbose_name='\u4e2a\u4eba\u5934\u50cf')),
                ('role', models.SmallIntegerField(choices=[(0, '\u5b66\u5458'), (1, '\u5bfc\u5e08'), (2, '\u8bb2\u5e08'), (3, '\u7ba1\u7406\u5458'), (4, '\u73ed\u4e3b\u4efb'), (5, '\u7ebf\u4e0b\u73ed\u4e3b\u4efb')], default=0, verbose_name='\u89d2\u8272')),
                ('memo', models.TextField(blank=True, default=None, help_text='json\u683c\u5f0f\u5b58\u50a8', null=True, verbose_name='\u5907\u6ce8')),
                ('date_joined', models.DateTimeField(auto_now_add=True, verbose_name='\u6ce8\u518c\u65f6\u95f4')),
                ('beli', models.IntegerField(default=1000)),
                ('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': '\u7528\u6237\u4fe1\u606f',
                'verbose_name_plural': '\u7528\u6237\u4fe1\u606f',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Coupon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, verbose_name='\u6d3b\u52a8\u540d\u79f0')),
                ('brief', models.TextField(blank=True, null=True, verbose_name='\u4f18\u60e0\u5238\u4ecb\u7ecd')),
                ('coupon_type', models.SmallIntegerField(choices=[(0, '\u7acb\u51cf\u5238'), (1, '\u6ee1\u51cf\u5238'), (2, '\u6298\u6263\u5238')], default=0, verbose_name='\u5238\u7c7b\u578b')),
                ('money_equivalent_value', models.FloatField(blank=True, null=True, verbose_name='\u7b49\u503c\u8d27\u5e01')),
                ('off_percent', models.PositiveSmallIntegerField(blank=True, help_text='\u53ea\u9488\u5bf9\u6298\u6263\u5238\uff0c\u4f8b7.9\u6298\uff0c\u519979', null=True, verbose_name='\u6298\u6263\u767e\u5206\u6bd4')),
                ('minimum_consume', models.PositiveIntegerField(default=0, help_text='\u4ec5\u5728\u6ee1\u51cf\u5238\u65f6\u586b\u5199\u6b64\u5b57\u6bb5', verbose_name='\u6700\u4f4e\u6d88\u8d39')),
                ('object_id', models.PositiveIntegerField(blank=True, help_text='\u53ef\u4ee5\u628a\u4f18\u60e0\u5238\u8ddf\u8bfe\u7a0b\u7ed1\u5b9a', null=True, verbose_name='\u7ed1\u5b9a\u8bfe\u7a0b')),
                ('quantity', models.PositiveIntegerField(default=1, verbose_name='\u6570\u91cf(\u5f20)')),
                ('open_date', models.DateField(verbose_name='\u4f18\u60e0\u5238\u9886\u53d6\u5f00\u59cb\u65f6\u95f4')),
                ('close_date', models.DateField(verbose_name='\u4f18\u60e0\u5238\u9886\u53d6\u7ed3\u675f\u65f6\u95f4')),
                ('valid_begin_date', models.DateField(blank=True, null=True, verbose_name='\u6709\u6548\u671f\u5f00\u59cb\u65f6\u95f4')),
                ('valid_end_date', models.DateField(blank=True, null=True, verbose_name='\u6709\u6548\u7ed3\u675f\u65f6\u95f4')),
                ('coupon_valid_days', models.PositiveIntegerField(blank=True, help_text='\u81ea\u5238\u88ab\u9886\u65f6\u5f00\u59cb\u7b97\u8d77', null=True, verbose_name='\u4f18\u60e0\u5238\u6709\u6548\u671f\uff08\u5929\uff09')),
                ('status', models.SmallIntegerField(choices=[(0, '\u4e0a\u7ebf'), (1, '\u4e0b\u7ebf')], default=0)),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
        ),
        migrations.CreateModel(
            name='CouponRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.SmallIntegerField(choices=[(0, '\u672a\u4f7f\u7528'), (1, '\u5df2\u4f7f\u7528'), (2, '\u5df2\u8fc7\u671f'), (3, '\u672a\u9886\u53d6')], default=0)),
                ('get_time', models.DateTimeField(blank=True, help_text='\u7528\u6237\u9886\u53d6\u65f6\u95f4', null=True, verbose_name='\u9886\u53d6\u65f6\u95f4')),
                ('used_time', models.DateTimeField(blank=True, null=True, verbose_name='\u4f7f\u7528\u65f6\u95f4')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='\u751f\u6210\u65f6\u95f4')),
                ('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='\u4f7f\u7528\u8005')),
                ('coupon', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Coupon')),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, unique=True, verbose_name='\u6a21\u5757')),
                ('course_img', models.CharField(max_length=255)),
                ('course_type', models.SmallIntegerField(choices=[(0, '\u4ed8\u8d39'), (1, 'VIP\u4e13\u4eab'), (2, '\u5b66\u4f4d\u8bfe\u7a0b')])),
                ('brief', models.TextField(max_length=2048, verbose_name='\u8bfe\u7a0b\u6982\u8ff0')),
                ('level', models.SmallIntegerField(choices=[(0, '\u521d\u7ea7'), (1, '\u4e2d\u7ea7'), (2, '\u9ad8\u7ea7')], default=1)),
                ('pub_date', models.DateField(blank=True, null=True, verbose_name='\u53d1\u5e03\u65e5\u671f')),
                ('period', models.PositiveIntegerField(default=7, verbose_name='\u5efa\u8bae\u5b66\u4e60\u5468\u671f(days)')),
                ('order', models.IntegerField(help_text='\u4ece\u4e0a\u4e00\u4e2a\u8bfe\u7a0b\u6570\u5b57\u5f80\u540e\u6392', verbose_name='\u8bfe\u7a0b\u987a\u5e8f')),
                ('attachment_path', models.CharField(blank=True, max_length=128, null=True, verbose_name='\u8bfe\u4ef6\u8def\u5f84')),
                ('status', models.SmallIntegerField(choices=[(0, '\u4e0a\u7ebf'), (1, '\u4e0b\u7ebf'), (2, '\u9884\u4e0a\u7ebf')], default=0)),
            ],
        ),
        migrations.CreateModel(
            name='CourseChapter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chapter', models.SmallIntegerField(default=1, verbose_name='\u7b2c\u51e0\u7ae0')),
                ('name', models.CharField(max_length=128)),
                ('summary', models.TextField(blank=True, null=True, verbose_name='\u7ae0\u8282\u4ecb\u7ecd')),
                ('is_create', models.BooleanField(default=True, verbose_name='\u662f\u5426\u521b\u5efa\u9898\u5e93\u8fdb\u5ea6')),
                ('pub_date', models.DateTimeField(auto_now_add=True, verbose_name='\u53d1\u5e03\u65e5\u671f')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coursechapters', to='api.Course')),
            ],
        ),
        migrations.CreateModel(
            name='CourseDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hours', models.IntegerField(verbose_name='\u8bfe\u65f6')),
                ('course_slogan', models.CharField(blank=True, max_length=125, null=True)),
                ('video_brief_link', models.CharField(blank=True, max_length=255, null=True)),
                ('why_study', models.TextField(verbose_name='\u4e3a\u4ec0\u4e48\u5b66\u4e60\u8fd9\u95e8\u8bfe\u7a0b')),
                ('what_to_study_brief', models.TextField(verbose_name='\u6211\u5c06\u5b66\u5230\u54ea\u4e9b\u5185\u5bb9')),
                ('career_improvement', models.TextField(verbose_name='\u6b64\u9879\u76ee\u5982\u4f55\u6709\u52a9\u4e8e\u6211\u7684\u804c\u4e1a\u751f\u6daf')),
                ('prerequisite', models.TextField(max_length=1024, verbose_name='\u8bfe\u7a0b\u5148\u4fee\u8981\u6c42')),
                ('course', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.Course')),
                ('recommend_courses', models.ManyToManyField(blank=True, related_name='recommend_by', to='api.Course')),
            ],
        ),
        migrations.CreateModel(
            name='CourseSection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('order', models.PositiveSmallIntegerField(help_text='\u5efa\u8bae\u6bcf\u4e2a\u8bfe\u65f6\u4e4b\u95f4\u7a7a1\u81f32\u4e2a\u503c\uff0c\u4ee5\u5907\u540e\u7eed\u63d2\u5165\u8bfe\u65f6', verbose_name='\u8bfe\u65f6\u6392\u5e8f')),
                ('section_type', models.SmallIntegerField(choices=[(0, '\u6587\u6863'), (1, '\u7ec3\u4e60'), (2, '\u89c6\u9891')], default=2)),
                ('section_link', models.CharField(blank=True, help_text='\u82e5\u662fvideo\uff0c\u586bvid,\u82e5\u662f\u6587\u6863\uff0c\u586blink', max_length=255, null=True)),
                ('video_time', models.CharField(blank=True, max_length=32, null=True, verbose_name='\u89c6\u9891\u65f6\u957f')),
                ('pub_date', models.DateTimeField(auto_now_add=True, verbose_name='\u53d1\u5e03\u65f6\u95f4')),
                ('free_trail', models.BooleanField(default=False, verbose_name='\u662f\u5426\u53ef\u8bd5\u770b')),
                ('is_flash', models.BooleanField(default=False, verbose_name='\u662f\u5426\u4f7f\u7528FLASH\u64ad\u653e')),
                ('player', models.SmallIntegerField(choices=[(0, 'CC'), (1, 'POLYV'), (2, 'ALI')], default=1, help_text='\u89c6\u9891\u64ad\u653e\u5668\u9009\u62e9')),
                ('chapter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coursesection', to='api.CourseChapter')),
            ],
        ),
        migrations.CreateModel(
            name='OftenAskedQuestion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('question', models.CharField(max_length=255)),
                ('answer', models.TextField(max_length=1024)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'verbose_name_plural': '\u5e38\u89c1\u95ee\u9898',
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('payment_type', models.SmallIntegerField(choices=[(0, '\u5fae\u4fe1'), (1, '\u652f\u4ed8\u5b9d'), (2, '\u4f18\u60e0\u7801'), (3, '\u8d1d\u91cc'), (4, '\u94f6\u8054')])),
                ('payment_number', models.CharField(blank=True, max_length=128, null=True, verbose_name='\u652f\u4ed8\u7b2c3\u65b9\u8ba2\u5355\u53f7')),
                ('order_number', models.CharField(max_length=128, unique=True, verbose_name='\u8ba2\u5355\u53f7')),
                ('actual_amount', models.FloatField(verbose_name='\u5b9e\u4ed8\u91d1\u989d')),
                ('status', models.SmallIntegerField(choices=[(0, '\u4ea4\u6613\u6210\u529f'), (1, '\u5f85\u652f\u4ed8'), (2, '\u9000\u8d39\u7533\u8bf7\u4e2d'), (3, '\u5df2\u9000\u8d39'), (4, '\u4e3b\u52a8\u53d6\u6d88'), (5, '\u8d85\u65f6\u53d6\u6d88')], verbose_name='\u72b6\u6001')),
                ('order_type', models.SmallIntegerField(choices=[(0, '\u7528\u6237\u4e0b\u5355'), (1, '\u7ebf\u4e0b\u73ed\u521b\u5efa')], default=0, verbose_name='\u8ba2\u5355\u7c7b\u578b')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='\u8ba2\u5355\u751f\u6210\u65f6\u95f4')),
                ('pay_time', models.DateTimeField(blank=True, null=True, verbose_name='\u4ed8\u6b3e\u65f6\u95f4')),
                ('cancel_time', models.DateTimeField(blank=True, null=True, verbose_name='\u8ba2\u5355\u53d6\u6d88\u65f6\u95f4')),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OrderDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('original_price', models.FloatField(verbose_name='\u8bfe\u7a0b\u539f\u4ef7')),
                ('price', models.FloatField(verbose_name='\u6298\u540e\u4ef7\u683c')),
                ('content', models.CharField(blank=True, max_length=255, null=True)),
                ('valid_period_display', models.CharField(max_length=32, verbose_name='\u6709\u6548\u671f\u663e\u793a')),
                ('valid_period', models.PositiveIntegerField(verbose_name='\u6709\u6548\u671f(days)')),
                ('memo', models.CharField(blank=True, max_length=255, null=True)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Order')),
            ],
        ),
        migrations.CreateModel(
            name='PricePolicy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('valid_period', models.SmallIntegerField(choices=[(1, '1\u5929'), (3, '3\u5929'), (7, '1\u5468'), (14, '2\u5468'), (30, '1\u4e2a\u6708'), (60, '2\u4e2a\u6708'), (90, '3\u4e2a\u6708'), (120, '4\u4e2a\u6708'), (180, '6\u4e2a\u6708'), (210, '12\u4e2a\u6708'), (540, '18\u4e2a\u6708'), (720, '24\u4e2a\u6708'), (722, '24\u4e2a\u6708'), (723, '24\u4e2a\u6708')])),
                ('price', models.FloatField()),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('role', models.SmallIntegerField(choices=[(0, '\u8bb2\u5e08'), (1, '\u5bfc\u5e08')], default=0)),
                ('title', models.CharField(max_length=64, verbose_name='\u804c\u4f4d\u3001\u804c\u79f0')),
                ('signature', models.CharField(blank=True, help_text='\u5bfc\u5e08\u7b7e\u540d', max_length=255, null=True)),
                ('image', models.CharField(max_length=128)),
                ('brief', models.TextField(max_length=1024)),
            ],
        ),
        migrations.CreateModel(
            name='Token',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(max_length=40)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='\u521b\u5efa\u65f6\u95f4')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='auth_token', to=settings.AUTH_USER_MODEL, verbose_name='\u5173\u8054\u7528\u6237')),
            ],
        ),
        migrations.AddField(
            model_name='coursedetail',
            name='teachers',
            field=models.ManyToManyField(to='api.Teacher', verbose_name='\u8bfe\u7a0b\u8bb2\u5e08'),
        ),
        migrations.AddField(
            model_name='couponrecord',
            name='order',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Order', verbose_name='\u5173\u8054\u8ba2\u5355'),
        ),
        migrations.AlterUniqueTogether(
            name='pricepolicy',
            unique_together=set([('content_type', 'object_id', 'valid_period')]),
        ),
        migrations.AlterUniqueTogether(
            name='orderdetail',
            unique_together=set([('order', 'content_type', 'object_id')]),
        ),
        migrations.AlterUniqueTogether(
            name='oftenaskedquestion',
            unique_together=set([('content_type', 'object_id', 'question')]),
        ),
        migrations.AlterUniqueTogether(
            name='coursesection',
            unique_together=set([('chapter', 'section_link')]),
        ),
        migrations.AlterUniqueTogether(
            name='coursechapter',
            unique_together=set([('course', 'chapter')]),
        ),
    ]
Example #6
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')),
                ('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)),
                ('email_confirmed', models.BooleanField(default=False)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Food',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
                ('description',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('counter', models.PositiveIntegerField()),
                ('vegetarian', models.BooleanField()),
                ('vegan', models.BooleanField()),
                ('halal', models.BooleanField()),
                ('lactose_free', models.BooleanField()),
                ('gluten_free', models.BooleanField()),
                ('bio', models.BooleanField()),
                ('expiration_date',
                 models.DateField(
                     validators=[fridge.validators.expiration_date_validator])
                 ),
            ],
        ),
        migrations.CreateModel(
            name='Fridge',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
                ('address', models.CharField(max_length=45)),
                ('city', models.CharField(max_length=45)),
                ('zip_code',
                 models.CharField(max_length=45,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          '^\\d{4}$', 'This NPA is not valid')
                                  ])),
                ('phone_number',
                 models.CharField(max_length=12,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          '^(\\+41|0)\\d{9}$',
                                          'This phone number is not valid.')
                                  ])),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
                ('image', models.ImageField(upload_to='images/')),
                ('is_active', models.BooleanField(default=False)),
                ('user',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Sponsor',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
                ('logo', models.ImageField(upload_to='images/')),
                ('website', models.URLField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TemperatureControl',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateField()),
                ('temperature', models.FloatField()),
                ('visa', models.CharField(max_length=45)),
                ('fridge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='fridge.fridge')),
            ],
        ),
        migrations.CreateModel(
            name='SpecialDay',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(max_length=200)),
                ('is_open', models.BooleanField(default=False)),
                ('from_date', models.DateField()),
                ('to_date', models.DateField(blank=True, null=True)),
                ('from_hour', models.TimeField(blank=True, null=True)),
                ('to_hour', models.TimeField(blank=True, null=True)),
                ('fridge',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='fridge.fridge')),
            ],
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantity', models.PositiveIntegerField()),
                ('food',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='fridge.food')),
                ('user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ReportContent',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('food',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='fridge.food')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OpeningHour',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('weekday',
                 models.PositiveSmallIntegerField(choices=[(0, 'Monday'),
                                                           (1, 'Tuesday'),
                                                           (2, 'Wednesday'),
                                                           (3, 'Thursday'),
                                                           (4, 'Friday'),
                                                           (5, 'Saturday'),
                                                           (6, 'Sunday')],
                                                  default=0)),
                ('from_hour', models.TimeField()),
                ('to_hour', models.TimeField()),
                ('fridge',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='fridge.fridge')),
            ],
        ),
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateField()),
                ('product_name', models.CharField(max_length=45)),
                ('product_number', models.IntegerField()),
                ('temperature', models.FloatField()),
                ('visa', models.CharField(max_length=45)),
                ('fridge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='fridge.fridge')),
            ],
        ),
        migrations.CreateModel(
            name='FridgeFollowing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('fridge',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='fridge.fridge')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='food',
            name='fridge',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='fridge.fridge'),
        ),
        migrations.AddField(
            model_name='food',
            name='user',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email', models.EmailField(max_length=254, unique=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': '1. User',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('phone_number', models.CharField(max_length=50)),
                ('address',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('user_type',
                 models.CharField(choices=[('1', 'Bidder'), ('2', 'Seller')],
                                  max_length=10)),
                ('active', models.BooleanField(default=True)),
                ('email_confirmed', models.BooleanField(default=False)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='user_profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Profile',
                'verbose_name_plural': '2. Profile',
            },
        ),
        migrations.CreateModel(
            name='PaymentCreditCard',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('card_holder', models.CharField(max_length=250)),
                ('card_number', models.CharField(max_length=255)),
                ('expiration', models.DateTimeField()),
                ('security_code',
                 models.CharField(
                     max_length=4,
                     validators=[
                         django.core.validators.RegexValidator('^\\d{1,10}$')
                     ])),
                ('postal_code', models.CharField(max_length=20)),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='user_payment_credit_card',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'PaymentCreditCard',
                'verbose_name_plural': '3. PaymentCreditCard',
            },
        ),
    ]
Example #8
0
class Migration(migrations.Migration):

    initial = True


    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')),
            ],
            options={
                'db_table': 'auth_user_church',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course_title', models.CharField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='Members',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('datestamp', models.DateTimeField(auto_now=True)),
                ('street_address', models.CharField(max_length=150)),
                ('street_address_line_2', models.CharField(blank=True, max_length=150, null=True)),
                ('city', models.CharField(max_length=100)),
                ('state_abbrev', models.CharField(max_length=2)),
                ('zip_code', models.IntegerField()),
                ('phone_number', models.CharField(max_length=20)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Members',
            },
        ),
        migrations.CreateModel(
            name='Enrollment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='course_enrollment', to='main.course')),
                ('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='member_enrollment', to='main.members')),
            ],
            options={
                'unique_together': {('course', 'member')},
            },
        ),
        migrations.AddField(
            model_name='course',
            name='teacher',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='course_teacher', to='main.members'),
        ),
        migrations.CreateModel(
            name='Church',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('street_address', models.CharField(max_length=150)),
                ('street_address_line_2', models.CharField(blank=True, max_length=150, null=True)),
                ('city', models.CharField(max_length=100)),
                ('state_abbrev', models.CharField(max_length=2)),
                ('zip_code', models.IntegerField()),
                ('phone_number', models.CharField(max_length=20)),
            ],
            options={
                'unique_together': {('name', 'phone_number')},
            },
        ),
        migrations.CreateModel(
            name='BibleVerse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('verse_words', models.CharField(max_length=20000)),
                ('book', models.CharField(max_length=200)),
                ('chapter', models.IntegerField()),
                ('verse_number', models.IntegerField()),
            ],
            options={
                'unique_together': {('verse_words', 'book', 'chapter', 'verse_number')},
            },
        ),
        migrations.AddField(
            model_name='user',
            name='church',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_church', to='main.church'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
        migrations.CreateModel(
            name='Minutes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('meeting_date', models.DateTimeField()),
                ('minutes_details', models.CharField(max_length=20000)),
                ('datestamp', models.DateTimeField(auto_now=True)),
                ('recorder', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='minutes_recorder', to='main.members')),
            ],
            options={
                'unique_together': {('meeting_date', 'recorder')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='course',
            unique_together={('course_title', 'teacher')},
        ),
        migrations.CreateModel(
            name='Attendance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attendance_date', models.DateField()),
                ('enrollment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='enrollment_attendance', to='main.enrollment')),
            ],
            options={
                'ordering': ['-attendance_date'],
                'unique_together': {('attendance_date',)},
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='MyUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('role',
                 models.CharField(choices=[('1', 'مدیر'), ('2', 'معاون'),
                                           ('3', 'معلم'), ('4', 'دانش آموز')],
                                  default='1',
                                  max_length=1)),
                ('reset_code', models.CharField(max_length=5, 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='Images',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('image',
                 models.ImageField(
                     null=True,
                     upload_to='uploads',
                     validators=[school.validators.validate_image_size])),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='userDoc',
            fields=[
                ('uuid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('religion', models.CharField(max_length=100, null=True)),
                ('userPhoto',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('userNationalCardPhoto',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('userIdCardPhoto',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('user_pNum', models.CharField(max_length=11, null=True)),
                ('home_pNum', models.CharField(max_length=11, null=True)),
                ('address', models.CharField(max_length=250, null=True)),
                ('zipCode', models.CharField(max_length=10, null=True)),
                ('personalCode', models.CharField(max_length=10, null=True)),
                ('nationalCode',
                 models.CharField(max_length=10, null=True, unique=True)),
                ('father_nationalCode',
                 models.CharField(blank=True, max_length=10, null=True)),
                ('father_name',
                 models.CharField(blank=True, max_length=40, null=True)),
                ('father_pNum',
                 models.CharField(blank=True, max_length=11, null=True)),
                ('father_jobName',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('father_jobAddress',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('father_job_pNum',
                 models.CharField(blank=True, max_length=11, null=True)),
                ('father_job_postalCode',
                 models.CharField(blank=True, max_length=10, null=True)),
                ('mother_nationalCode',
                 models.CharField(blank=True, max_length=10, null=True)),
                ('mother_name',
                 models.CharField(blank=True, max_length=40, null=True)),
                ('mother_pNum',
                 models.CharField(blank=True, max_length=11, null=True)),
                ('mother_jobName',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('mother_jobAddress',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('mother_job_pNum',
                 models.CharField(blank=True, max_length=11, null=True)),
                ('mother_job_postalCode',
                 models.CharField(blank=True, max_length=10, null=True)),
                ('citizen_Num',
                 models.CharField(blank=True, max_length=11, null=True)),
                ('date_of_birth', models.CharField(max_length=50, null=True)),
                ('place_of_birth', models.CharField(max_length=50, null=True)),
                ('citizen',
                 models.CharField(choices=[('1', 'اتباع ایرانی'),
                                           ('0', 'اتباع خارجی')],
                                  default='1',
                                  max_length=1)),
                ('gender',
                 models.CharField(choices=[('1', 'آقا'), ('0', 'خانوم')],
                                  default='1',
                                  max_length=1)),
                ('section',
                 models.CharField(choices=[('0', 'پیش دبستانی'),
                                           ('1', 'اول ابتدایی'),
                                           ('2', 'دوم ابتدایی'),
                                           ('3', 'سوم ابتدایی'),
                                           ('4', 'چهارم ابتدایی'),
                                           ('5', 'پنجم ابتدایی'), ('6', 'ششم'),
                                           ('7', 'هفتم'), ('8', 'هشتم'),
                                           ('9', 'نهم'), ('10', 'پرسنل')],
                                  default='10',
                                  max_length=2)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='doc',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('user', 'nationalCode')},
            },
        ),
    ]
Example #10
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Movie',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('rating', models.IntegerField()),
                ('prod_year', models.IntegerField()),
                ('image', models.ImageField(blank=True,
                                            null=True,
                                            upload_to='')),
                ('type',
                 models.CharField(choices=[('n', 'None'), ('p', 'planned'),
                                           ('w', 'watched')],
                                  default='n',
                                  max_length=50,
                                  null=True)),
            ],
            options={
                'verbose_name': 'Movie',
                'verbose_name_plural': 'Movies',
            },
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('text', models.CharField(max_length=200)),
                ('created_at', models.DateField(auto_now_add=True)),
                ('created_by',
                 models.ForeignKey(default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Customer')),
                ('movie',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='reviews',
                                   to='api.Movie')),
            ],
        ),
        migrations.AddField(
            model_name='customer',
            name='my_movies',
            field=models.ManyToManyField(default=None, to='api.Movie'),
        ),
    ]
Example #11
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('gender',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(max_length=255),
                     default=False,
                     size=None)),
                ('situation',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(max_length=255),
                     default=False,
                     size=None)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_moderator', models.BooleanField(default=False)),
                ('about_me', models.TextField(blank=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='Adress',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('region', models.TextField()),
                ('departement', models.TextField()),
                ('postal_code', models.TextField(max_length=5)),
                ('city', models.TextField()),
                ('street_adress', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.TextField()),
                ('icon', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email_confirmed', models.BooleanField(default=False)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Place',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.TextField()),
                ('picture', models.TextField(blank=True)),
                ('description', models.TextField(blank=True)),
                ('website', models.TextField(blank=True)),
                ('contact_mail', models.TextField(blank=True)),
                ('contact_phone', models.TextField(blank=True)),
                ('can_be_seen', models.BooleanField(default=False)),
                ('adress',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='application.Adress')),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='application.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment', models.TextField()),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('score_global', models.CharField(max_length=1)),
                ('can_you_enter', models.BooleanField()),
                ('are_you_safe_enough', models.BooleanField()),
                ('is_mixed_lockers', models.BooleanField()),
                ('is_inclusive_lockers', models.BooleanField()),
                ('has_respectful_staff', models.BooleanField()),
                ('place',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='application.Place')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddConstraint(
            model_name='place',
            constraint=models.UniqueConstraint(fields=('category', 'adress'),
                                               name='saved_place'),
        ),
        migrations.AddConstraint(
            model_name='comment',
            constraint=models.UniqueConstraint(fields=('user', 'place'),
                                               name='saved_comment'),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email',
                 models.EmailField(error_messages={
                     'unique': 'El email que ingreso ya existe'
                 },
                                   max_length=254,
                                   unique=True,
                                   verbose_name='email addres')),
                ('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='Asignacion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('portada',
                 models.ImageField(blank=True, null=True,
                                   upload_to='Portada')),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Ciclo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('anio',
                 models.PositiveIntegerField(validators=[
                     django.core.validators.MinValueValidator(1990)
                 ])),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Curso',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Estudiante',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('telefono_contacto',
                 models.CharField(blank=True, max_length=15, null=True)),
                ('direccion_contacto',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
                ('asignacion_estudiante',
                 models.ManyToManyField(related_name='estudiante_asignaciones',
                                        to='api.Asignacion')),
            ],
        ),
        migrations.CreateModel(
            name='Nivel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Profesion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Rol',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Seccion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tarea',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('titulo', models.CharField(max_length=100)),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('fecha_entrega', models.DateField()),
                ('hora_entrega', models.TimeField()),
                ('nota', models.FloatField(default=0)),
                ('archivo',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to='tarea_maestros')),
                ('permitir_archivo', models.BooleanField(default=True)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
                ('asignacion',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='asignaciones',
                                   to='api.Asignacion')),
            ],
        ),
        migrations.CreateModel(
            name='Tarea_Estudiante',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('texto',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('archivo',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to='tarea_alumnos')),
                ('punteo', models.FloatField(default=0)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
                ('estudiante',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='estudiantes',
                                   to='api.Estudiante')),
                ('tarea',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='tareas',
                                   to='api.Tarea')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('phone', models.CharField(blank=True,
                                           max_length=15,
                                           null=True)),
                ('address',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('avatar',
                 models.ImageField(blank=True, null=True, upload_to='Avatar')),
                ('is_first_login',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Verifica si es la primera vez que se logueo en la aplicaion',
                     verbose_name='first_login')),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
                ('rol',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='roles',
                                   to='api.Rol')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profiles',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('titulo', models.CharField(max_length=100)),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('archivo', models.FileField(upload_to='material_apoyo')),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
                ('asignacion',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='material_asignaciones',
                                   to='api.Asignacion')),
            ],
        ),
        migrations.CreateModel(
            name='Maestro',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
                ('maestro_profile',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='maestros_profiles',
                     to='api.Profile')),
                ('profesion',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='profesiones',
                                   to='api.Profesion')),
            ],
        ),
        migrations.CreateModel(
            name='Grado',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
                ('nivel',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='niveles',
                                   to='api.Nivel')),
            ],
        ),
        migrations.CreateModel(
            name='Evento',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('titulo', models.CharField(max_length=100)),
                ('descripcion',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('fecha', models.DateField()),
                ('hora', models.TimeField()),
                ('activo', models.BooleanField(default=True)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('modificado', models.DateTimeField(auto_now=True)),
                ('ciclo_escolar',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='ciclos',
                                   to='api.Ciclo')),
            ],
        ),
        migrations.AddField(
            model_name='estudiante',
            name='estudiante_profile',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='profiles',
                to='api.Profile'),
        ),
        migrations.AddField(
            model_name='asignacion',
            name='asignacion_ciclo',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='asignacion_ciclos',
                to='api.Ciclo'),
        ),
        migrations.AddField(
            model_name='asignacion',
            name='curso',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='asignacion_cursos',
                to='api.Curso'),
        ),
        migrations.AddField(
            model_name='asignacion',
            name='grado',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='asignacion_grados',
                to='api.Grado'),
        ),
        migrations.AddField(
            model_name='asignacion',
            name='maestro',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='asignacion_maestros',
                to='api.Maestro'),
        ),
        migrations.AddField(
            model_name='asignacion',
            name='seccion',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='asignacion_secciones',
                to='api.Seccion'),
        ),
    ]
Example #13
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('is_patient', models.BooleanField(default=False)),
                ('is_doctor', models.BooleanField(default=False)),
                ('is_pharmacist', models.BooleanField(default=False)),
                ('is_insurance', 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()),
            ],
        ),
        migrations.CreateModel(
            name='Doctor',
            fields=[
                ('ssn',
                 models.IntegerField(primary_key=True,
                                     serialize=False,
                                     verbose_name='SSN')),
                ('first_name',
                 models.CharField(max_length=50, verbose_name='First Name')),
                ('last_name',
                 models.CharField(max_length=50, verbose_name='Last Name')),
                ('gender',
                 models.CharField(choices=[('M', 'Male'), ('F', 'Female')],
                                  default='M',
                                  max_length=3)),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=40,
                                   null=True,
                                   unique=True,
                                   verbose_name='Email')),
                ('specialty', models.CharField(default='ENT', max_length=50)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['ssn'],
            },
        ),
        migrations.CreateModel(
            name='Insurance',
            fields=[
                ('ssn',
                 models.IntegerField(primary_key=True,
                                     serialize=False,
                                     verbose_name='SSN')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=50,
                                  verbose_name='Name')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['ssn'],
            },
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('ssn',
                 models.IntegerField(primary_key=True,
                                     serialize=False,
                                     verbose_name='SSN')),
                ('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(blank=True,
                                   max_length=40,
                                   null=True,
                                   unique=True,
                                   verbose_name='Email')),
                ('gender',
                 models.CharField(choices=[('M', 'Male'), ('F', 'Female')],
                                  default='M',
                                  max_length=3)),
                ('phone',
                 models.IntegerField(blank=True,
                                     null=True,
                                     verbose_name='Phone Number')),
                ('creditcard',
                 models.IntegerField(blank=True,
                                     null=True,
                                     verbose_name='Credit Card Number')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['ssn'],
            },
        ),
        migrations.CreateModel(
            name='Pharmacist',
            fields=[
                ('ssn',
                 models.IntegerField(primary_key=True,
                                     serialize=False,
                                     verbose_name='SSN')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=50,
                                  verbose_name='Name')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['ssn'],
            },
        ),
        migrations.CreateModel(
            name='Prescription',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('dop',
                 models.DateField(null=True,
                                  verbose_name='Prescription Date')),
                ('desc',
                 models.CharField(max_length=150,
                                  null=True,
                                  verbose_name='Prescription Details')),
                ('doctor',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='home.Doctor')),
                ('patient',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='home.Patient')),
            ],
            options={
                'ordering': ['-dop'],
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[],
            options={
                'ordering': ('username', ),
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='TwoFAUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid', models.CharField(max_length=10000)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='reflections.User')),
            ],
        ),
        migrations.CreateModel(
            name='Reflection',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=10000, null=True)),
                ('content', models.CharField(max_length=10000)),
                ('createdAt', models.DateTimeField(auto_now=True, null=True)),
                ('isPublic', models.BooleanField(default=True)),
                ('owner',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='owner',
                                   to='reflections.User')),
                ('sharedWith',
                 models.ManyToManyField(blank=True,
                                        related_name='sharedWith',
                                        to='reflections.User')),
            ],
        ),
    ]
Example #15
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='FollowRelationship',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='PublisherModel',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='auth.user')),
                ('bio', models.CharField(blank=True, max_length=250)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='TagModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=15)),
                ('ocurrencies', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='CompanyModel',
            fields=[
                ('publishermodel_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='micro.publishermodel')),
                ('apiKey',
                 models.CharField(
                     max_length=50,
                     validators=[
                         django.core.validators.MinLengthValidator(50)
                     ])),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('micro.publishermodel', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='PublicMessageModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('text', models.CharField(max_length=140)),
                ('date', models.DateField()),
                ('author',
                 models.ForeignKey(on_delete=models.SET(
                     micro.models.get_sentinel_user),
                                   related_name='author',
                                   to='micro.publishermodel')),
                ('mentions',
                 models.ManyToManyField(blank=True,
                                        related_name='mentions',
                                        to='micro.PublisherModel')),
                ('tags', models.ManyToManyField(blank=True,
                                                to='micro.TagModel')),
            ],
        ),
        migrations.CreateModel(
            name='PrivateMessageModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateField()),
                ('text', models.CharField(max_length=250)),
                ('destination',
                 models.ForeignKey(on_delete=models.SET(
                     micro.models.get_sentinel_user),
                                   related_name='destination',
                                   to='micro.publishermodel')),
                ('source',
                 models.ForeignKey(on_delete=models.SET(
                     micro.models.get_sentinel_user),
                                   related_name='source',
                                   to='micro.publishermodel')),
            ],
        ),
        migrations.CreateModel(
            name='UserModel',
            fields=[
                ('publishermodel_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='micro.publishermodel')),
                ('phone', models.CharField(blank=True, max_length=20)),
                ('birthday', models.DateField(blank=True)),
                ('follows',
                 models.ManyToManyField(blank=True,
                                        through='micro.FollowRelationship',
                                        to='micro.UserModel')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('micro.publishermodel', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='followrelationship',
            name='from_user',
            field=models.ForeignKey(on_delete=models.SET(
                micro.models.get_sentinel_user),
                                    related_name='from_user',
                                    to='micro.usermodel'),
        ),
        migrations.AddField(
            model_name='followrelationship',
            name='to_user',
            field=models.ForeignKey(on_delete=models.SET(
                micro.models.get_sentinel_user),
                                    related_name='to_user',
                                    to='micro.usermodel'),
        ),
        migrations.AlterUniqueTogether(
            name='followrelationship',
            unique_together={('from_user', 'to_user')},
        ),
    ]
Example #16
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='BaseRBPIUser',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('receive_message',
                 models.BooleanField(default=True,
                                     verbose_name='receive messages')),
                ('is_admin',
                 models.BooleanField(
                     default=False,
                     help_text=
                     '\u042d\u0442\u043e \u043e\u0442\u0434\u0435\u043b \u043a\u0430\u0434\u0440\u043e\u0432 ?',
                     verbose_name='is admin')),
                ('is_group',
                 models.BooleanField(
                     default=False,
                     help_text=
                     '\u042d\u0442\u043e \u0433\u0440\u0443\u043f\u043f\u0430 \u043b\u0438\u0446 ?',
                     verbose_name='is group')),
            ],
            options={
                'permissions':
                (('can_control_RBPI_users', 'To HR department'), ),
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='LaunchProvider',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('receive_message',
                 models.BooleanField(default=True,
                                     verbose_name='receive messages')),
            ],
            options={
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='LegalEntity',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 models.DateTimeField(auto_now=True, verbose_name='created')),
                ('modified',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='modified')),
                ('status_name',
                 models.PositiveSmallIntegerField(choices=[(0, 'ON_ACTIVE'),
                                                           (1, 'ON_DELETED'),
                                                           (2, 'ON_MODIFY'),
                                                           (3, 'ON_REPAIR')],
                                                  default=0,
                                                  verbose_name='status')),
                ('name_of_legal',
                 models.CharField(max_length=40, verbose_name='Legal Name')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MessagesHistory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 models.DateTimeField(auto_now=True, verbose_name='created')),
                ('modified',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='modified')),
                ('status_name',
                 models.PositiveSmallIntegerField(choices=[(0, 'ON_ACTIVE'),
                                                           (1, 'ON_DELETED'),
                                                           (2, 'ON_MODIFY'),
                                                           (3, 'ON_REPAIR')],
                                                  default=0,
                                                  verbose_name='status')),
                ('from_user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sender',
                                   to='core.BaseRBPIUser',
                                   verbose_name='from user')),
                ('to_user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='receiver',
                                   to=settings.AUTH_USER_MODEL)),
                ('user_modifier',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='core.BaseRBPIUser',
                                   verbose_name='modifier user')),
            ],
            options={
                'permissions': (('can_create_messages', 'To HR department'), ),
            },
        ),
        migrations.CreateModel(
            name='Office',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 models.DateTimeField(auto_now=True, verbose_name='created')),
                ('modified',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='modified')),
                ('status_name',
                 models.PositiveSmallIntegerField(choices=[(0, 'ON_ACTIVE'),
                                                           (1, 'ON_DELETED'),
                                                           (2, 'ON_MODIFY'),
                                                           (3, 'ON_REPAIR')],
                                                  default=0,
                                                  verbose_name='status')),
                ('name', models.CharField(max_length=40,
                                          verbose_name='office')),
                ('place',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='provider',
                                   to='core.LaunchProvider',
                                   verbose_name='provider')),
                ('user_modifier',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='core.BaseRBPIUser',
                                   verbose_name='modifier user')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='legalentity',
            name='offices',
            field=models.ManyToManyField(blank=True,
                                         related_name='offices',
                                         to='core.Office',
                                         verbose_name='Offices'),
        ),
        migrations.AddField(
            model_name='legalentity',
            name='user_modifier',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='core.BaseRBPIUser',
                verbose_name='modifier user'),
        ),
        migrations.AddField(
            model_name='baserbpiuser',
            name='legal_entity',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='core.LegalEntity'),
        ),
    ]
Example #17
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BaseModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('update_time', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Permission',
            fields=[
                ('basemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='system.BaseModel')),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
                ('code', models.CharField(blank=True, max_length=100, null=True)),
                ('desc', models.TextField(blank=True, null=True)),
                ('order_num', models.IntegerField(default=0)),
                ('icon', models.CharField(blank=True, max_length=100, null=True)),
                ('type', models.IntegerField(choices=[(2, '页面'), (1, '菜单')], default=1)),
                ('perms', models.CharField(blank=True, max_length=500, null=True)),
                ('is_top', models.BooleanField(default=False)),
                ('parent_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='system.Permission')),
            ],
            options={
                'verbose_name': '权限',
            },
            bases=('system.basemodel',),
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('basemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='system.BaseModel')),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
                ('desc', models.TextField(blank=True, null=True)),
                ('permission', models.ManyToManyField(related_name='permission_roles', to='system.Permission')),
            ],
            options={
                'verbose_name': '角色',
            },
            bases=('system.basemodel',),
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('name', models.CharField(default='', max_length=20, verbose_name='姓名')),
                ('birthday', models.DateField(blank=True, null=True, verbose_name='出生日期')),
                ('gender', models.CharField(choices=[('male', '男'), ('famale', '女')], default='male', max_length=10, verbose_name='性别')),
                ('mobile', models.CharField(default='', max_length=11, verbose_name='电话')),
                ('email', models.EmailField(max_length=100, verbose_name='邮箱')),
                ('avatar', models.ImageField(blank=True, null=True, upload_to='avatar')),
                ('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')),
                ('roles', models.ManyToManyField(related_name='role_users', to='system.Role')),
            ],
            options={
                'verbose_name': '用户表',
                'verbose_name_plural': '用户表',
                'ordering': ['-id'],
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
Example #18
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('isbn', models.IntegerField()),
                ('bname', models.CharField(max_length=20)),
                ('author', models.CharField(max_length=20)),
                ('publish_date', models.DateField()),
                ('publisher', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='StudentUser',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('college', models.CharField(max_length=20)),
                ('studentnum', models.IntegerField()),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='BorrowMessage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('borrow_date', models.DateTimeField(auto_now_add=True)),
                ('return_date', models.DateTimeField()),
                ('status', models.BooleanField()),
                ('book',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='booksys.Book')),
                ('person',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='booksys.StudentUser')),
            ],
        ),
    ]
Example #19
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email', models.EmailField(max_length=254)),
                ('phone_number', models.CharField(max_length=25)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='AnimalBrand',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('animal_brand', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='AnimalType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('animal_type', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Pet',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('chip_number', models.CharField(max_length=50, unique=True)),
                ('animal_brand',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='storeCore.AnimalType')),
                ('animal_type',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='Animal_Type',
                     to='storeCore.AnimalType')),
            ],
        ),
        migrations.CreateModel(
            name='Owner',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('storeCore.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Veterinary',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('storeCore.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='animalbrand',
            name='animal_type',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='storeCore.AnimalType'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(
                blank=True,
                help_text=
                'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Group',
                verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
        migrations.AddField(
            model_name='pet',
            name='owner',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='storeCore.Owner'),
        ),
    ]
Example #20
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='SpecialistMessageList',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('photo', models.CharField(blank=True, max_length=240)),
                ('nick', models.CharField(blank=True, max_length=40)),
                ('date', models.DateField(blank=True)),
                ('title', models.CharField(blank=True, max_length=240)),
                ('total', models.IntegerField(blank=True)),
                ('client', models.IntegerField(blank=True)),
                ('specialist', models.IntegerField(blank=True)),
            ],
            options={
                'managed': False,
                'db_table': 'specialist_message_list',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('nick', models.CharField(blank=True, max_length=45, null=True, verbose_name='nick')),
                ('email_exact', models.CharField(max_length=150, unique=True, verbose_name='email')),
                ('telephone', models.CharField(blank=True, max_length=14, null=True, verbose_name='phone')),
                ('cellphone', models.CharField(blank=True, max_length=14, null=True, verbose_name='cellphone')),
                ('photo', models.CharField(max_length=250, null=True, verbose_name='photo')),
                ('document_type', models.PositiveIntegerField(choices=[(1, 'DNI'), (2, 'Passport'), (3, 'Foreign Card')], verbose_name='type document')),
                ('document_number', models.CharField(max_length=45, verbose_name='document number')),
                ('img_document_number', models.CharField(max_length=250, null=True, verbose_name='upload document')),
                ('ruc', models.CharField(blank=True, max_length=40, null=True)),
                ('code', models.CharField(max_length=45, verbose_name='code')),
                ('anonymous', models.BooleanField(default=True, verbose_name='anonymous')),
                ('updated_at', models.DateTimeField(auto_now_add=True, verbose_name='updated at')),
                ('foreign_address', models.CharField(blank=True, max_length=200, null=True, verbose_name='foreign address')),
                ('key', models.CharField(blank=True, max_length=90, null=True)),
                ('status', models.PositiveIntegerField(choices=[(1, 'Pending'), (2, 'Activate'), (3, 'Reject'), (4, 'Deactivated')], default=1)),
            ],
            options={
                'verbose_name_plural': 'users',
                'abstract': False,
                'verbose_name': 'user',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('street', models.CharField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Bank',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Bank')),
                ('code', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=45, unique=True)),
                ('image', models.CharField(max_length=169)),
                ('description', models.CharField(max_length=255)),
                ('fixed_commission', models.DecimalField(decimal_places=2, max_digits=10, null=True)),
                ('variable_commission', models.DecimalField(decimal_places=2, max_digits=10, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Ciiu',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=4, unique=True)),
                ('description', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Clasification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Contract',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_file', models.CharField(max_length=255)),
                ('created_at', models.DateField(auto_now_add=True)),
                ('active', models.BooleanField(default=False)),
                ('validity_months', models.PositiveIntegerField()),
                ('expiration_date', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='ContractType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('descripcion', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Countries',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=90, unique=True)),
                ('code_phone', models.CharField(max_length=4)),
                ('iso_code', models.CharField(max_length=4, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=55)),
            ],
        ),
        migrations.CreateModel(
            name='District',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=55)),
            ],
        ),
        migrations.CreateModel(
            name='EconomicSector',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
            ],
        ),
        migrations.CreateModel(
            name='FeeMonthSeller',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_month', models.DateField()),
                ('fee_plans', models.PositiveIntegerField()),
                ('fee_contacts', models.PositiveIntegerField()),
                ('complete_fee_products', models.PositiveIntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='GroupMessage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='LevelInstruction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
            ],
        ),
        migrations.CreateModel(
            name='LogPaymentsCreditCard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('successful', models.BooleanField()),
                ('description', models.CharField(max_length=50)),
                ('code_api', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Match',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10)),
            ],
        ),
        migrations.CreateModel(
            name='MatchAcquired',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('cause', models.TextField()),
                ('status', models.PositiveIntegerField(choices=[(1, 'Requested'), (2, 'Accepted'), (3, 'Declined')])),
                ('paid_by_client', models.BooleanField(default=True)),
                ('paid_by_specialist', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='MatchAcquiredFiles',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file_url', models.CharField(max_length=100)),
                ('type_file', models.PositiveIntegerField(choices=[(2, 'Image'), (3, 'Voice'), (4, 'Document')])),
                ('match_acquired', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.MatchAcquired')),
            ],
        ),
        migrations.CreateModel(
            name='MatchAcquiredLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('changed_on', models.DateTimeField(auto_now_add=True)),
                ('action', models.CharField(max_length=50)),
                ('status', models.PositiveIntegerField(choices=[(1, 'Requested'), (2, 'Accepted'), (3, 'Declined')])),
                ('declined', models.NullBooleanField()),
                ('declined_motive', models.CharField(max_length=255, null=True)),
                ('match_acquired', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.MatchAcquired')),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField(blank=True)),
                ('msg_type', models.CharField(blank=True, choices=[('q', 'query'), ('r', 'requery'), ('a', 'answer')], max_length=1)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('content_type', models.PositiveIntegerField(choices=[(1, 'Text'), (2, 'Image'), (3, 'Video'), (4, 'Voice'), (5, 'Document')])),
                ('viewed', models.BooleanField(default=False)),
                ('file_url', models.CharField(blank=True, max_length=100)),
                ('code', models.CharField(max_length=45, verbose_name='code')),
                ('room', models.CharField(max_length=200)),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.GroupMessage')),
                ('message_reference', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='ref', to='api.Message')),
            ],
        ),
        migrations.CreateModel(
            name='MonthlyFee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fee_amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('fee_order_number', models.PositiveIntegerField()),
                ('fee_quantity', models.PositiveIntegerField()),
                ('reference_number', models.CharField(max_length=20)),
                ('pay_before', models.DateField()),
                ('status', models.PositiveIntegerField(choices=[(1, 'Pending'), (2, 'Paid')])),
            ],
        ),
        migrations.CreateModel(
            name='NotificationsBack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.CharField(max_length=255, verbose_name='message')),
                ('viewed', models.BooleanField(default=False, verbose_name='viewed')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('code', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Objection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=65)),
            ],
        ),
        migrations.CreateModel(
            name='Parameter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('parameter', models.CharField(max_length=45)),
                ('value', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.FloatField()),
                ('operation_number', models.CharField(max_length=12)),
                ('agency_code', models.CharField(max_length=10)),
                ('account_number_drawer', models.CharField(max_length=50)),
                ('check_number', models.CharField(max_length=50)),
                ('credit_cart_number', models.CharField(max_length=30)),
                ('credit_card_cvc', models.CharField(max_length=3)),
                ('credit_card_exp_date', models.DateField()),
                ('authorization_date', models.DateTimeField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('status', models.PositiveIntegerField(choices=[(1, 'Pending'), (2, 'Accepted'), (3, 'Declined')])),
                ('observations', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='PaymentType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
                ('description', models.CharField(max_length=200, null=True)),
                ('status', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Permmission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('description', models.CharField(max_length=220)),
                ('code', models.CharField(max_length=12)),
            ],
        ),
        migrations.CreateModel(
            name='ProductType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.CharField(max_length=200)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Province',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=55)),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Department')),
            ],
        ),
        migrations.CreateModel(
            name='Query',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('status', models.PositiveIntegerField(choices=[(1, 'Requested'), (2, 'Accepted'), (3, 'Answered'), (4, 'To score'), (5, 'Absolved')])),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('calification', models.PositiveSmallIntegerField(null=True)),
                ('changed_on', models.DateTimeField(auto_now=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='QueryLogs',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('action', models.CharField(max_length=10)),
                ('description', models.CharField(max_length=200, null=True)),
                ('changed_on', models.DateTimeField()),
                ('status_log', models.PositiveIntegerField(choices=[(1, 'Requested'), (2, 'Accepted'), (3, 'Answered'), (4, 'To score'), (5, 'Absolved')])),
                ('derived', models.NullBooleanField()),
                ('declined', models.NullBooleanField()),
                ('declined_motive', models.TextField(null=True)),
                ('query', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Query')),
            ],
        ),
        migrations.CreateModel(
            name='QueryPlans',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('query_quantity', models.IntegerField()),
                ('validity_months', models.PositiveIntegerField()),
                ('maximum_response_time', models.PositiveIntegerField()),
                ('price', models.DecimalField(decimal_places=4, max_digits=10)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('is_active', models.BooleanField(default=True)),
                ('clasification', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Clasification')),
                ('product_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ProductType')),
            ],
        ),
        migrations.CreateModel(
            name='QueryPlansAcquired',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('expiration_date', models.DateField(null=True)),
                ('validity_months', models.PositiveIntegerField()),
                ('available_queries', models.PositiveIntegerField()),
                ('query_quantity', models.PositiveIntegerField()),
                ('activation_date', models.DateField(null=True)),
                ('is_active', models.BooleanField(default=False)),
                ('is_chosen', models.BooleanField(default=False)),
                ('available_requeries', models.PositiveIntegerField()),
                ('maximum_response_time', models.PositiveIntegerField()),
                ('acquired_at', models.DateTimeField(auto_now_add=True)),
                ('plan_name', models.CharField(max_length=50)),
                ('query_plans', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.QueryPlans')),
            ],
        ),
        migrations.CreateModel(
            name='RecoveryPassword',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('is_active', models.BooleanField(default=False)),
                ('code', models.CharField(max_length=6)),
            ],
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('permissions', models.ManyToManyField(db_table='role_permission', to='api.Permmission')),
            ],
        ),
        migrations.CreateModel(
            name='Sale',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('place', models.CharField(max_length=100)),
                ('total_amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('reference_number', models.CharField(max_length=20)),
                ('description', models.TextField()),
                ('is_fee', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='SaleDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('description', models.TextField()),
                ('discount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('pin_code', models.CharField(max_length=50)),
                ('is_billable', models.BooleanField(default=True)),
                ('contract', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Contract')),
                ('product_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ProductType')),
                ('sale', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Sale')),
            ],
        ),
        migrations.CreateModel(
            name='SellerContactNoEfective',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=45, null=True)),
                ('last_name', models.CharField(max_length=55, null=True)),
                ('type_contact', models.CharField(choices=[('n', 'Natural'), ('b', 'Business')], max_length=1)),
                ('document_type', models.PositiveIntegerField(choices=[(1, 'DNI'), (2, 'Passport'), (3, 'Foreign Card')])),
                ('document_number', models.CharField(max_length=45)),
                ('email', models.CharField(max_length=150, null=True)),
                ('civil_state', models.CharField(choices=[('c', 'cohabiting'), ('e', 'separated'), ('m', 'married'), ('w', 'widower'), ('d', 'divorced'), ('s', 'single')], max_length=1, null=True)),
                ('birthdate', models.DateField(null=True)),
                ('institute', models.CharField(blank=True, max_length=100, null=True)),
                ('activity_description', models.CharField(blank=True, max_length=255, null=True)),
                ('photo', models.CharField(max_length=250, null=True)),
                ('about', models.CharField(blank=True, max_length=255, null=True)),
                ('cellphone', models.CharField(blank=True, max_length=14, null=True)),
                ('telephone', models.CharField(blank=True, max_length=14, null=True)),
                ('ocupation', models.PositiveIntegerField(choices=[(1, 'Employer'), (2, 'Independent worker'), (3, 'Employee'), (4, 'Worker'), (5, 'Worker in a family business'), (6, 'Home worker'), (7, 'Other')], default=7, null=True)),
                ('profession', models.CharField(max_length=45, null=True)),
                ('business_name', models.CharField(max_length=45, null=True)),
                ('commercial_reason', models.CharField(max_length=45, null=True)),
                ('agent_firstname', models.CharField(max_length=45, null=True)),
                ('agent_lastname', models.CharField(max_length=45, null=True)),
                ('sex', models.CharField(blank=True, choices=[('m', 'Male'), ('f', 'Female')], max_length=1)),
                ('latitude', models.CharField(blank=True, max_length=45)),
                ('longitude', models.CharField(blank=True, max_length=45)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('position', models.CharField(max_length=45, null=True)),
                ('ruc', models.CharField(blank=True, max_length=40, null=True)),
                ('address', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Address')),
                ('ciiu', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Ciiu')),
                ('economic_sector', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.EconomicSector')),
                ('level_instruction', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.LevelInstruction')),
                ('nationality', models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, to='api.Countries')),
                ('objection', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Objection')),
            ],
        ),
        migrations.CreateModel(
            name='SellerNonBillablePlans',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveIntegerField()),
                ('number_month', models.PositiveIntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('query_plans', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.QueryPlans')),
            ],
        ),
        migrations.CreateModel(
            name='Zone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
                ('districts', models.ManyToManyField(db_table='zones_districts', to='api.District')),
            ],
        ),
        migrations.CreateModel(
            name='Client',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('type_client', models.CharField(choices=[('n', 'Natural'), ('b', 'Business')], max_length=1)),
                ('sex', models.CharField(blank=True, choices=[('m', 'Male'), ('f', 'Female')], max_length=1)),
                ('commercial_reason', models.CharField(max_length=45, null=True)),
                ('civil_state', models.CharField(choices=[('c', 'cohabiting'), ('e', 'separated'), ('m', 'married'), ('w', 'widower'), ('d', 'divorced'), ('s', 'single')], max_length=1, null=True)),
                ('birthdate', models.DateField(null=True)),
                ('activity_description', models.CharField(blank=True, max_length=255, null=True)),
                ('institute', models.CharField(blank=True, max_length=100, null=True)),
                ('ocupation', models.PositiveIntegerField(choices=[(1, 'Employer'), (2, 'Independent worker'), (3, 'Employee'), (4, 'Worker'), (5, 'Worker in a family business'), (6, 'Home worker'), (7, 'Other')], null=True)),
                ('about', models.CharField(blank=True, max_length=255, null=True)),
                ('business_name', models.CharField(max_length=45, null=True)),
                ('agent_firstname', models.CharField(max_length=45, null=True)),
                ('agent_lastname', models.CharField(max_length=45, null=True)),
                ('position', models.CharField(max_length=45, null=True)),
                ('profession', models.CharField(max_length=45, null=True)),
                ('ciiu', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Ciiu')),
                ('economic_sector', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.EconomicSector')),
                ('level_instruction', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.LevelInstruction')),
            ],
            options={
                'verbose_name_plural': 'Clients',
                'verbose_name': 'Client',
            },
            bases=('api.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Seller',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('cv', models.CharField(blank=True, max_length=100, null=True)),
                ('ciiu', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Ciiu')),
                ('zone', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Zone')),
            ],
            options={
                'verbose_name_plural': 'Sellers',
                'verbose_name': 'Seller',
            },
            bases=('api.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Specialist',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('business_name', models.CharField(max_length=55)),
                ('type_specialist', models.CharField(choices=[('m', 'Main'), ('a', 'Associate')], max_length=1)),
                ('star_rating', models.IntegerField(null=True)),
                ('cv', models.CharField(max_length=150, null=True)),
                ('payment_per_answer', models.DecimalField(decimal_places=2, max_digits=10)),
            ],
            options={
                'verbose_name_plural': 'Specialists',
                'verbose_name': 'Specialist',
            },
            bases=('api.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='recoverypassword',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='queryplansacquired',
            name='sale_detail',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.SaleDetail'),
        ),
        migrations.AddField(
            model_name='query',
            name='acquired_plan',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.QueryPlansAcquired'),
        ),
        migrations.AddField(
            model_name='query',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Category'),
        ),
        migrations.AddField(
            model_name='payment',
            name='authorized_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='payment',
            name='bank',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Bank'),
        ),
        migrations.AddField(
            model_name='payment',
            name='payment_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.PaymentType'),
        ),
        migrations.AddField(
            model_name='notificationsback',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='monthlyfee',
            name='payment',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Payment'),
        ),
        migrations.AddField(
            model_name='monthlyfee',
            name='sale_detail',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.SaleDetail'),
        ),
        migrations.AddField(
            model_name='message',
            name='query',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Query'),
        ),
        migrations.AddField(
            model_name='matchacquired',
            name='sale_detail',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.SaleDetail'),
        ),
        migrations.AddField(
            model_name='match',
            name='product_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ProductType'),
        ),
        migrations.AddField(
            model_name='match',
            name='speciality',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Category'),
        ),
        migrations.AddField(
            model_name='district',
            name='province',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Province'),
        ),
        migrations.AddField(
            model_name='contract',
            name='type_contract',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ContractType'),
        ),
        migrations.AddField(
            model_name='category',
            name='contract',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Contract'),
        ),
        migrations.AddField(
            model_name='address',
            name='department',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Department'),
        ),
        migrations.AddField(
            model_name='address',
            name='district',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.District'),
        ),
        migrations.AddField(
            model_name='address',
            name='province',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Province'),
        ),
        migrations.AddField(
            model_name='user',
            name='address',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Address', verbose_name='address'),
        ),
        migrations.AddField(
            model_name='user',
            name='code_cellphone',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='prefix_cellphone', to='api.Countries'),
        ),
        migrations.AddField(
            model_name='user',
            name='code_telephone',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='prefix_telephone', to='api.Countries'),
        ),
        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='nationality',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, to='api.Countries', verbose_name='nationality'),
        ),
        migrations.AddField(
            model_name='user',
            name='residence_country',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='residence', to='api.Countries', verbose_name='residence country'),
        ),
        migrations.AddField(
            model_name='user',
            name='role',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, to='api.Role', verbose_name='role'),
        ),
        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='specialist',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Category'),
        ),
        migrations.AddField(
            model_name='sellernonbillableplans',
            name='seller',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Seller'),
        ),
        migrations.AddField(
            model_name='sellercontactnoefective',
            name='seller',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Seller'),
        ),
        migrations.AddField(
            model_name='sale',
            name='client',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Client'),
        ),
        migrations.AddField(
            model_name='sale',
            name='seller',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Seller'),
        ),
        migrations.AddField(
            model_name='queryplansacquired',
            name='client',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Client'),
        ),
        migrations.AddField(
            model_name='queryplans',
            name='non_billable',
            field=models.ManyToManyField(through='api.SellerNonBillablePlans', to='api.Seller'),
        ),
        migrations.AddField(
            model_name='querylogs',
            name='from_specialist',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='al_especialista', to='api.Specialist'),
        ),
        migrations.AddField(
            model_name='querylogs',
            name='to_specialist',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='del_especialista', to='api.Specialist'),
        ),
        migrations.AddField(
            model_name='query',
            name='client',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Client'),
        ),
        migrations.AddField(
            model_name='query',
            name='specialist',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Specialist'),
        ),
        migrations.AddField(
            model_name='message',
            name='specialist',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Specialist'),
        ),
        migrations.AddField(
            model_name='matchacquired',
            name='client',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Client'),
        ),
        migrations.AddField(
            model_name='matchacquired',
            name='specialist',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Specialist'),
        ),
        migrations.AddField(
            model_name='feemonthseller',
            name='seller',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.Seller'),
        ),
        migrations.AddField(
            model_name='client',
            name='seller_asigned',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Seller'),
        ),
    ]
Example #21
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')),
                ('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(max_length=50, unique=True)),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(max_length=50)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('profile_picture', models.CharField(max_length=100)),
                ('phone', models.CharField(max_length=8)),
                ('country', models.CharField(max_length=50)),
                ('city', models.CharField(max_length=50)),
                ('nit', models.CharField(max_length=14)),
                ('nrc', models.CharField(max_length=50)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Marca',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
                ('slogan', models.CharField(max_length=50)),
                ('descripcion', models.CharField(max_length=50)),
                ('user_profile',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='marca',
                                   to='guantapp.UserProfile')),
            ],
            options={
                'ordering': ['nombre'],
            },
        ),
    ]
Example #22
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('is_student', models.BooleanField(default=False)),
                ('is_teacher', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Class',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('location', models.CharField(max_length=50)),
                ('time_day',
                 models.CharField(choices=[('MON', 'Monday'),
                                           ('TUE', 'Tuesday'),
                                           ('WED', 'Wednesday'),
                                           ('THU', 'Thursday'),
                                           ('FRI', 'Friday'),
                                           ('SAT', 'Saturday'),
                                           ('SUN', 'Sunday')],
                                  default='WED',
                                  max_length=3)),
                ('time_start',
                 models.TimeField(default=datetime.time(15, 30))),
                ('time_end', models.TimeField(default=datetime.time(16, 30))),
            ],
        ),
        migrations.CreateModel(
            name='MemberLevel',
            fields=[
                ('level_status',
                 models.CharField(choices=[('B', 'Bronze'), ('S', 'Silver'),
                                           ('G', 'Gold'), ('P', 'Platinum'),
                                           ('D', 'Diamond')],
                                  default='B',
                                  max_length=1,
                                  primary_key=True,
                                  serialize=False)),
                ('price', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Member',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('funds', models.FloatField(default=0)),
                ('expired_date',
                 models.DateField(default=datetime.date(2019, 5, 29))),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=254)),
                ('phone_number',
                 models.CharField(
                     blank=True,
                     max_length=17,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             "Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.",
                             regex='^\\+?1?\\d{9,15}$')
                     ])),
                ('classes', models.ManyToManyField(to='login.Class')),
                ('level',
                 models.ForeignKey(default='B',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='login.MemberLevel')),
            ],
        ),
        migrations.CreateModel(
            name='Staff',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(
                blank=True,
                help_text=
                'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Group',
                verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
        migrations.AddField(
            model_name='class',
            name='staff',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='login.Staff'),
        ),
    ]
Example #23
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Province',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('province_abbr', models.CharField(blank=True, max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('street', models.TextField(max_length=50)),
                ('city', models.TextField(max_length=50)),
                ('state',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='jobsite.Province')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Job',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('company_name', models.CharField(max_length=50)),
                ('description', models.TextField()),
                ('title', models.CharField(max_length=50)),
                ('address_one', models.CharField(max_length=120)),
                ('address_two', models.CharField(max_length=120)),
                ('state',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='jobsite.Province')),
            ],
        ),
        migrations.CreateModel(
            name='Application',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user_firstname', models.CharField(max_length=30)),
                ('user_lastname', models.CharField(max_length=30)),
                ('user_email', models.EmailField(max_length=254)),
                ('user_city', models.CharField(max_length=50)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('cover_letter', models.TextField(blank=True)),
                ('cover_letter_attachment',
                 models.FileField(blank=True,
                                  upload_to='documents/cover_letters/')),
                ('resume', models.TextField(blank=True)),
                ('resume_attachment',
                 models.FileField(blank=True, upload_to='documents/resumes/')),
                ('job',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='jobsite.Job')),
                ('user_state',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='jobsite.Province')),
            ],
        ),
    ]
Example #24
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="User",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("password",
                 models.CharField(max_length=128, verbose_name="password")),
                (
                    "last_login",
                    models.DateTimeField(blank=True,
                                         null=True,
                                         verbose_name="last login"),
                ),
                (
                    "is_superuser",
                    models.BooleanField(
                        default=False,
                        help_text=
                        "Designates that this user has all permissions without explicitly assigning them.",
                        verbose_name="superuser status",
                    ),
                ),
                (
                    "username",
                    models.CharField(
                        error_messages={
                            "unique":
                            "A user with that username already exists."
                        },
                        help_text=
                        "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
                        max_length=150,
                        unique=True,
                        validators=[
                            django.contrib.auth.validators.
                            UnicodeUsernameValidator()
                        ],
                        verbose_name="username",
                    ),
                ),
                (
                    "first_name",
                    models.CharField(blank=True,
                                     max_length=30,
                                     verbose_name="first name"),
                ),
                (
                    "last_name",
                    models.CharField(blank=True,
                                     max_length=150,
                                     verbose_name="last name"),
                ),
                (
                    "email",
                    models.EmailField(blank=True,
                                      max_length=254,
                                      verbose_name="email address"),
                ),
                (
                    "is_staff",
                    models.BooleanField(
                        default=False,
                        help_text=
                        "Designates whether the user can log into this admin site.",
                        verbose_name="staff status",
                    ),
                ),
                (
                    "is_active",
                    models.BooleanField(
                        default=True,
                        help_text=
                        "Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
                        verbose_name="active",
                    ),
                ),
                (
                    "date_joined",
                    models.DateTimeField(default=django.utils.timezone.now,
                                         verbose_name="date joined"),
                ),
                (
                    "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="Account",
            fields=[
                (
                    "user_id",
                    models.BigIntegerField(editable=False,
                                           primary_key=True,
                                           serialize=False),
                ),
                (
                    "screen_name",
                    models.CharField(editable=False, max_length=30, null=True),
                ),
                (
                    "screen_name_lower",
                    models.CharField(editable=False, max_length=30, null=True),
                ),
                ("profile_updated",
                 models.DateTimeField(editable=False, null=True)),
            ],
        ),
        migrations.CreateModel(
            name="Profile",
            fields=[
                (
                    "user_id",
                    models.BigIntegerField(editable=False,
                                           primary_key=True,
                                           serialize=False),
                ),
                (
                    "json",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        editable=False),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Relationship",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "type",
                    models.IntegerField(
                        choices=[(1, "follows"), (2, "blocks"), (3, "mutes")],
                        editable=False,
                    ),
                ),
                ("updated", models.DateTimeField(editable=False)),
                ("until", models.DateTimeField(blank=True, null=True)),
                (
                    "object",
                    models.ForeignKey(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="relationship_object_set",
                        to="secateur.Account",
                    ),
                ),
                (
                    "subject",
                    models.ForeignKey(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="relationship_subject_set",
                        to="secateur.Account",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="account",
            name="profile",
            field=models.OneToOneField(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="secateur.Profile",
            ),
        ),
        migrations.AddIndex(
            model_name="relationship",
            index=models.Index(fields=["type", "subject"],
                               name="secateur_re_type_2c4b68_idx"),
        ),
        migrations.AddIndex(
            model_name="relationship",
            index=models.Index(fields=["type", "object"],
                               name="secateur_re_type_2db0bf_idx"),
        ),
        migrations.AlterUniqueTogether(name="relationship",
                                       unique_together={("type", "subject",
                                                         "object")}),
        migrations.AddIndex(
            model_name="account",
            index=models.Index(fields=["screen_name"],
                               name="secateur_ac_screen__f4a619_idx"),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
        ('IMSAdmin', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('mobile', models.CharField(max_length=50)),
                ('city', models.CharField(max_length=50)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='CustomerPolicyComprehensive',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('effectiveFrom', models.DateField()),
                ('effectiveTill', models.DateField()),
                ('year', models.IntegerField()),
                ('value', models.FloatField()),
                ('totalAmount', models.FloatField()),
                ('commission', models.FloatField()),
                ('policyType', models.BooleanField()),
                ('name', models.CharField(max_length=50)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('repairType', models.BooleanField()),
                ('premium', models.FloatField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CustomerPolicyTP',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('effectiveFrom', models.DateField()),
                ('effectiveTill', models.DateField()),
                ('year', models.IntegerField()),
                ('value', models.FloatField()),
                ('totalAmount', models.FloatField()),
                ('commission', models.FloatField()),
                ('policyType', models.BooleanField()),
                ('name', models.CharField(max_length=50)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('fixedValue', models.FloatField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InsuranceCompany',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('name', models.CharField(max_length=50)),
                ('logo', models.ImageField(upload_to='')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PolicyComprehensive',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('repairType', models.BooleanField()),
                ('minVehicle', models.FloatField()),
                ('maxVehicle', models.FloatField()),
                ('premium', models.FloatField()),
                ('minAmount', models.FloatField()),
                ('commission', models.FloatField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('insuranceCompany',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='IMSAdmin.InsuranceCompany')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PolicyTP',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('fixedValue', models.FloatField()),
                ('minVehicle', models.FloatField()),
                ('maxVehicle', models.FloatField()),
                ('commission', models.FloatField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('insuranceCompany',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='IMSAdmin.InsuranceCompany')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VehicleMake',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('name', models.CharField(max_length=50)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VehicleModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=50)),
                ('make',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='IMSAdmin.VehicleMake')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VehicleValue',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('value', models.FloatField()),
                ('year', models.IntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('make',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='IMSAdmin.VehicleModel')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.DeleteModel(name='AdminProfile', ),
        migrations.AddField(
            model_name='customerpolicytp',
            name='insuranceCompany',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='IMSAdmin.InsuranceCompany'),
        ),
        migrations.AddField(
            model_name='customerpolicytp',
            name='model',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='IMSAdmin.VehicleModel'),
        ),
        migrations.AddField(
            model_name='customerpolicycomprehensive',
            name='insuranceCompany',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='IMSAdmin.InsuranceCompany'),
        ),
        migrations.AddField(
            model_name='customerpolicycomprehensive',
            name='model',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='IMSAdmin.VehicleModel'),
        ),
    ]
Example #26
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='UserInfo',
            fields=[
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('telephone',
                 models.CharField(max_length=11, null=True, unique=True)),
                ('avatar',
                 models.FileField(default='/avatars/default.png',
                                  upload_to='avatars/')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=50,
                                           verbose_name='文章标题')),
                ('desc', models.CharField(max_length=255,
                                          verbose_name='文章描述')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('content', models.TextField()),
                ('comment_count', models.IntegerField(default=0)),
                ('up_count', models.IntegerField(default=0)),
                ('down_count', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Article2Tag',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('article',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Article',
                                   verbose_name='文章')),
            ],
        ),
        migrations.CreateModel(
            name='ArticleUpDown',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('is_up', models.BooleanField(default=True)),
                ('article',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Article')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=64,
                                           verbose_name='个人博客标题')),
                ('site_name',
                 models.CharField(max_length=64, verbose_name='站点名称')),
                ('theme', models.CharField(max_length=32,
                                           verbose_name='博客主题')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=32,
                                           verbose_name='分类标题')),
                ('blog',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Blog',
                                   verbose_name='所属博客')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('content',
                 models.CharField(max_length=255, verbose_name='评论内容')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('article',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Article',
                                   verbose_name='评论文章')),
                ('parent_comment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Comment')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='评论者')),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('nid', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=32,
                                           verbose_name='标签名称')),
                ('blog',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='blog.Blog',
                                   verbose_name='所属博客')),
            ],
        ),
        migrations.AddField(
            model_name='article2tag',
            name='tag',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='blog.Tag',
                verbose_name='标签'),
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='blog.Category'),
        ),
        migrations.AddField(
            model_name='article',
            name='tags',
            field=models.ManyToManyField(through='blog.Article2Tag',
                                         to='blog.Tag'),
        ),
        migrations.AddField(
            model_name='article',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='作者'),
        ),
        migrations.AddField(
            model_name='userinfo',
            name='blog',
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='blog.Blog'),
        ),
        migrations.AddField(
            model_name='userinfo',
            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='userinfo',
            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.AlterUniqueTogether(
            name='articleupdown',
            unique_together={('article', 'user')},
        ),
        migrations.AlterUniqueTogether(
            name='article2tag',
            unique_together={('article', 'tag')},
        ),
    ]
Example #27
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Fee',
            fields=[
                ('uuid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('amount', models.FloatField(default=0.0)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('uuid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('title', models.CharField(max_length=200, unique=True)),
                ('unit',
                 models.IntegerField(choices=[(0, 'hectareas'), (1, 'árboles'),
                                              (2, 'toneladas'), (3, 'euros')],
                                     default=3)),
                ('description', models.TextField()),
                ('visible', models.BooleanField(default=True)),
                ('got', models.IntegerField()),
                ('goal', models.IntegerField()),
                ('created_on', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Proyecto',
            },
        ),
        migrations.CreateModel(
            name='FeeDistribution',
            fields=[
                ('uuid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('percentage', models.FloatField(default=0.0)),
                ('fee',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Fee')),
                ('project',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.Project')),
            ],
            options={
                'verbose_name': 'DistribucionCuota',
            },
        ),
        migrations.CreateModel(
            name='Socio',
            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')),
                ('type',
                 models.IntegerField(choices=[(0, 'Admin'), (1, 'Socio'),
                                              (2, 'Trabajador'),
                                              (3, 'Voluntario')],
                                     default=3)),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('username',
                 models.CharField(blank=True, max_length=150, unique=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('fee',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.Fee')),
                ('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': 'Socio',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
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')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('is_customer', models.BooleanField(default=False)),
                ('is_sp', models.BooleanField(default=False)),
                ('first_name', models.CharField(blank=True, max_length=50, null=True)),
                ('last_name', models.CharField(blank=True, max_length=100, null=True)),
                ('email', models.EmailField(max_length=254)),
                ('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='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_of_order', models.DateField(auto_now_add=True, null=True)),
                ('no_of_orders', models.CharField(max_length=100, null=True)),
                ('last_date', models.DateField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='account.user')),
                ('phone_number', models.CharField(max_length=10)),
                ('alt_phone_number', models.CharField(blank=True, max_length=10, null=True)),
                ('date_create', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='PlaceAnOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('Pending', 'Pending'), ('out for Delivery', 'out for Delivery'), ('Delivered', 'Delivered'), ('Cancel', 'Cancel')], default='Pending', max_length=200, null=True)),
                ('new_date', models.DateField(auto_now_add=True, null=True)),
                ('time', models.TimeField(null=True)),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.order')),
            ],
        ),
        migrations.CreateModel(
            name='CustomerMenuItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item_name', models.CharField(max_length=500)),
                ('price', models.CharField(max_length=20)),
                ('quantity', models.PositiveIntegerField()),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.placeanorder')),
            ],
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('state', models.CharField(max_length=150)),
                ('city', models.CharField(max_length=100)),
                ('pin_no', models.CharField(max_length=20)),
                ('Area_name', models.CharField(max_length=200)),
                ('land_mark', models.CharField(max_length=200)),
                ('building_name', models.CharField(max_length=200)),
                ('flate_number', models.CharField(max_length=100)),
                ('date_of_order', models.DateField(auto_now_add=True)),
                ('total_amount', models.FloatField(null=True)),
                ('placeanorder', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.placeanorder')),
            ],
        ),
        migrations.CreateModel(
            name='ServiceProvider',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='account.user')),
                ('admin_name', models.CharField(max_length=100)),
                ('company_name', models.CharField(max_length=200)),
                ('phone_no', models.CharField(max_length=10)),
                ('alt_phone_no', models.CharField(max_length=10)),
                ('state', models.CharField(max_length=150)),
                ('city', models.CharField(max_length=100)),
                ('pin_no', models.CharField(max_length=20)),
                ('Area_name', models.CharField(max_length=200)),
                ('land_mark', models.CharField(max_length=200)),
                ('building_name', models.CharField(max_length=200)),
                ('flate_number', models.CharField(max_length=100)),
                ('customer', models.ManyToManyField(to='account.Customer')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='customer',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='account.customer'),
        ),
        migrations.AddField(
            model_name='order',
            name='sp',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.serviceprovider'),
        ),
        migrations.CreateModel(
            name='Menu',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item_name', models.CharField(max_length=500)),
                ('price', models.CharField(max_length=20)),
                ('category', models.CharField(max_length=200, null=True)),
                ('sp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='account.serviceprovider')),
            ],
        ),
    ]
Example #29
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('followers',
                 models.ManyToManyField(related_name='followings',
                                        to=settings.AUTH_USER_MODEL)),
                ('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='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nickname', models.CharField(blank=True, max_length=40)),
                ('introduction', models.TextField(blank=True)),
                ('image',
                 imagekit.models.fields.ProcessedImageField(
                     blank=True, upload_to='profile/images')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
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')),
                ('is_warden', 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()),
            ],
        ),
        migrations.CreateModel(
            name='Hostel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('gender', models.CharField(choices=[('M', 'Male'), ('F', 'Female')], default=None, max_length=1, null=True)),
                ('caretaker', models.CharField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Room',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('no', models.CharField(max_length=5)),
                ('room_type', models.CharField(choices=[('S', 'Single Occupancy'), ('D', 'Double Occupancy')], default=None, max_length=1)),
                ('vacant', models.BooleanField(default=False)),
                ('repair', models.CharField(blank=True, max_length=100)),
                ('hostel', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostelapp.hostel')),
            ],
        ),
        migrations.CreateModel(
            name='Warden',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, null=True)),
                ('hostel', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='hostelapp.hostel')),
                ('user', models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('student_name', models.CharField(max_length=200, null=True)),
                ('student_mbl_no', models.PositiveIntegerField(default=None, null=True)),
                ('adress', models.CharField(default=None, max_length=256, null=True)),
                ('father_name', models.CharField(max_length=200, null=True)),
                ('father_mbl_no', models.PositiveIntegerField(default=None, null=True)),
                ('USN', models.CharField(max_length=10, null=True, unique=True)),
                ('Branch', models.CharField(choices=[('CS', 'Computer Science'), ('IS', 'Information Science'), ('EC', 'Electronics And Communication'), ('EEE', 'Electrical And Electronics'), ('ME', 'Mecanical')], max_length=4)),
                ('dob', models.DateField(help_text='format : YYYY-MM-DD', max_length=10, null=True)),
                ('gender', models.CharField(choices=[('M', 'Male'), ('F', 'Female')], default='N', max_length=1, null=True)),
                ('room_allotted', models.BooleanField(default=False)),
                ('no_dues', models.BooleanField(default=True)),
                ('room', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='hostelapp.room')),
                ('user', models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Leave',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('reason', models.CharField(max_length=100)),
                ('accept', models.BooleanField(default=False)),
                ('reject', models.BooleanField(default=False)),
                ('confirm_time', models.DateTimeField(auto_now_add=True)),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hostelapp.student')),
            ],
        ),
    ]