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

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Contact',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('email', models.CharField(max_length=150)),
                ('feedback', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='UserProfileInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bio', models.CharField(max_length=500)),
                ('profile_pic',
                 models.ImageField(blank=True,
                                   upload_to=app_users.models.path_and_rename,
                                   verbose_name='Profile Picture')),
                ('user_type',
                 models.CharField(choices=[('teacher', 'teacher'),
                                           ('student', 'student'),
                                           ('parent', 'parent')],
                                  default='student',
                                  max_length=10)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='user_profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bio', models.CharField(blank=True, max_length=150)),
                ('profile_pic',
                 models.ImageField(blank=True,
                                   upload_to=app_users.models.path_and_rename,
                                   verbose_name='profilepic')),
                ('user_type', models.CharField(default='student',
                                               max_length=50)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Example #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('middlename',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('phone', models.CharField(blank=True,
                                           max_length=50,
                                           null=True)),
                ('photo',
                 models.ImageField(blank=True,
                                   max_length=1000,
                                   null=True,
                                   upload_to=app_users.models.only_filename)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]