コード例 #1
0
ファイル: 0001_initial.py プロジェクト: benidel/goodat_api
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('email', models.EmailField(db_index=True, max_length=254, unique=True, validators=[core.validators.CoreEmailValidator()])),
                ('first_name', models.CharField(blank=True, max_length=100, null=True)),
                ('last_name', models.CharField(blank=True, max_length=100, null=True)),
                ('avatar', models.ImageField(blank=True, null=True, upload_to=authentication.models.avatar_path)),
                ('bio', models.TextField(blank=True)),
                ('address', models.TextField(blank=True)),
                ('is_active', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
コード例 #2
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')),
                ('avatar',
                 models.ImageField(
                     blank=True, upload_to=authentication.models.upload_path)),
                ('bio', models.TextField(blank=True, max_length=255)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #3
0
ファイル: 0001_initial.py プロジェクト: jaywezz/maseno-olx-v1
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('category_name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('item_name', models.CharField(max_length=100)),
                ('item_description', models.TextField(max_length=100)),
                ('item_price', models.IntegerField()),
                ('item_image', models.ImageField(upload_to='items')),
                ('item_category',
                 models.CharField(choices=[
                     ('Select category', 'Select Category'),
                     ('Laptops', 'Laptops'), ('Phones', 'Phones'),
                     ('House equipment', 'House equipment'),
                     ('Electronics', 'Electronics'), ('Clothes', 'Clothes'),
                     ('Shoes', 'Shoes'), ('Stationary', 'Stationary')
                 ],
                                  default=0,
                                  max_length=20)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('item_owner',
                 models.ForeignKey(
                     default=authentication.models.DaemonStar_User,
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('last_name',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('location',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('url', models.CharField(blank=True, max_length=80,
                                         null=True)),
                ('profile_info',
                 models.TextField(blank=True, max_length=150, null=True)),
                ('created', models.DateField(auto_now_add=True)),
                ('picture',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=authentication.models.user_directory_path,
                     verbose_name='Picture')),
                ('favorites', models.ManyToManyField(to='post.Post')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #5
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('picture',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=authentication.models.
                                   group_based_upload_user_picture)),
                ('gender',
                 models.TextField(blank=True,
                                  choices=[(b'FEMALE', b'female'),
                                           (b'MALE', b'male')],
                                  max_length=10,
                                  null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'auth_profile',
            },
        ),
    ]
コード例 #6
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(blank=True,
                                  db_index=True,
                                  max_length=255,
                                  unique=True)),
                ('email',
                 models.EmailField(db_index=True, max_length=255,
                                   unique=True)),
                ('first_name',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('last_name',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('is_verified', models.BooleanField(default=False)),
                ('is_passenger', models.BooleanField(default=False)),
                ('is_driver', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('mobile_no',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=20,
                                  null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('password_string', models.CharField(max_length=500,
                                                     null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('image',
                 models.ImageField(
                     default='default.jpg',
                     null=True,
                     upload_to=authentication.models.author_image_upload)),
                ('about',
                 models.TextField(blank=True, max_length=800, null=True)),
                ('facebook',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('twitter',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('instagram',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('youtube',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('thumbnail',
                 models.ImageField(
                     default='default.jpg',
                     null=True,
                     upload_to=authentication.models.author_image_upload)),
                ('email_token', models.TextField(blank=True, null=True)),
                ('state',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('key', models.TextField(blank=True, null=True)),
                ('auth_provider',
                 models.CharField(default='email', max_length=255)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
コード例 #7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='Email Address')),
                ('dob',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Date of Birth')),
                ('marital_status',
                 models.CharField(blank=True,
                                  choices=[('M', 'Married'), ('S', 'Single')],
                                  max_length=1,
                                  null=True,
                                  verbose_name='Marital Status')),
                ('profile_photo',
                 models.ImageField(
                     blank=True,
                     default=
                     '/home/flash/Documents/Projects/beaprose2/beaprose/media/default/persion.svg',
                     null=True,
                     upload_to=authentication.models.upload_profile_photo,
                     verbose_name='Profile Photo')),
                ('phoneNumber',
                 models.CharField(blank=True,
                                  max_length=20,
                                  null=True,
                                  verbose_name='Phone Number')),
                ('phoneNumberVerified',
                 models.BooleanField(default=False,
                                     verbose_name='Phone Number Verified')),
                ('is_expert',
                 models.BooleanField(default=False,
                                     verbose_name='Expert Status')),
                ('is_customer',
                 models.BooleanField(default=False,
                                     verbose_name='Customer Status')),
                ('is_influencer',
                 models.BooleanField(default=False,
                                     verbose_name='Influencer Status')),
                ('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', authentication.managers.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='BillingCard',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('card_number', models.CharField(max_length=50)),
                ('card_name', models.CharField(max_length=100)),
                ('cvc', models.CharField(max_length=10)),
                ('expiry', models.CharField(max_length=5)),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Expert',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('hasAcceptedAgreement',
                 models.BooleanField(
                     default=False,
                     verbose_name='Has Accepted User Agreement?')),
                ('payment_cards',
                 models.ManyToManyField(to='authentication.BillingCard')),
            ],
        ),
        migrations.CreateModel(
            name='ExpertProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('headline',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Headline')),
                ('short_bio',
                 models.TextField(blank=True, verbose_name='Biography')),
                ('timezone',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Timezone')),
                ('country',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Country')),
                ('city',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='City')),
                ('skype_number',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Skype')),
                ('rate_per_hour', models.PositiveIntegerField()),
                ('is_long_term', models.BooleanField(default=False)),
                ('is_pro_bono', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Influencer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Keyword',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('keyword', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Newsletter',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email', models.EmailField(max_length=254)),
            ],
        ),
        migrations.CreateModel(
            name='Sector',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sector', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Skill',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('skill', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='WorkHistory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('job_title',
                 models.CharField(max_length=30, verbose_name='Job Title')),
                ('country_work',
                 models.CharField(max_length=30, verbose_name='Work Country')),
                ('city_work',
                 models.CharField(max_length=30, verbose_name='Work City')),
                ('role', models.CharField(max_length=30, verbose_name='Role')),
                ('start_date', models.DateField(verbose_name='Start Date')),
                ('end_date', models.DateField(verbose_name='End Date')),
            ],
        ),
        migrations.AddField(
            model_name='expertprofile',
            name='keywords',
            field=models.ManyToManyField(blank=True,
                                         related_name='experts',
                                         to='authentication.Keyword'),
        ),
        migrations.AddField(
            model_name='expertprofile',
            name='sectors',
            field=models.ManyToManyField(blank=True,
                                         related_name='experts',
                                         to='authentication.Sector'),
        ),
        migrations.AddField(
            model_name='expertprofile',
            name='skills',
            field=models.ManyToManyField(blank=True,
                                         related_name='experts',
                                         to='authentication.Skill'),
        ),
        migrations.AddField(
            model_name='expertprofile',
            name='work_history',
            field=models.ManyToManyField(blank=True,
                                         related_name='experts',
                                         to='authentication.WorkHistory'),
        ),
        migrations.AddField(
            model_name='expert',
            name='profile',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='authentication.ExpertProfile'),
        ),
        migrations.AddField(
            model_name='expert',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
    ]
コード例 #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='User',
            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')),
                ('name', models.CharField(max_length=30)),
                ('surname', models.CharField(max_length=30)),
                ('email', models.EmailField(max_length=256, unique=True)),
                ('password', models.CharField(max_length=128)),
                ('is_superuser', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('birthday', models.DateField(blank=True, null=True)),
                ('location', models.CharField(blank=True, max_length=256)),
                ('skills', models.CharField(blank=True, max_length=1024)),
                ('biography', models.TextField(blank=True)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', authentication.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Chat',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('users',
                 models.ManyToManyField(related_name='chats',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('description', models.TextField()),
                ('tags', models.CharField(blank=True, max_length=1024)),
                ('required_investments', models.FloatField()),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('cofounders',
                 models.ManyToManyField(related_name='cofounded_projects',
                                        to=settings.AUTH_USER_MODEL)),
                ('founder',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='founded_projects',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('text', models.TextField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('chat',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='upstarter.Chat')),
                ('user',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='messages',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Investment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('amount', models.FloatField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('investor',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='investments',
                     to=settings.AUTH_USER_MODEL)),
                ('project',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='investments',
                     to='upstarter.Project')),
            ],
        ),
    ]
コード例 #9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='AuthUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('username', models.CharField(max_length=50, unique=True)),
                ('email',
                 models.EmailField(max_length=255,
                                   unique=True,
                                   verbose_name='email address')),
                ('name', models.CharField(max_length=255)),
                ('date_of_birth', models.DateField()),
                ('contact_number', models.CharField(max_length=15)),
                ('bmdc_reg_number', models.CharField(max_length=15)),
                ('image',
                 models.ImageField(blank=True,
                                   max_length=500,
                                   null=True,
                                   upload_to='profileImages/')),
                ('about', models.TextField(blank=True, default='', null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'Dentist',
                'verbose_name_plural': 'Dentists',
            },
            managers=[
                ('objects', authentication.models.AuthUserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('start', models.TimeField()),
                ('end', models.TimeField()),
                ('branch_name',
                 models.CharField(choices=[('gazipur', 'GAZIPUR'),
                                           ('uttara', 'UTTARA')],
                                  default='uttara',
                                  max_length=15)),
                ('weekday',
                 models.CharField(choices=[('All', 'ALL'),
                                           ('Sunday', 'SUNDAY'),
                                           ('Monday', 'MONDAY'),
                                           ('Tuesday', 'TUESDAY'),
                                           ('Wednesday', 'WEDNESDAY'),
                                           ('Thursday', 'THURSDAY'),
                                           ('Friday', 'FRIDAY'),
                                           ('Saturday', 'SATURDAY')],
                                  default='Sunday',
                                  max_length=10)),
                ('max_patient', models.PositiveIntegerField(default=15)),
                ('dentist',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='schedule',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Campus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('address', models.CharField(max_length=60)),
            ],
            options={
                'verbose_name': 'Campus',
                'verbose_name_plural': 'Campus',
            },
        ),
        migrations.CreateModel(
            name='Cursus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=30, unique=True)),
            ],
            options={
                'verbose_name': 'Cursus',
                'verbose_name_plural': 'Cursus',
            },
        ),
        migrations.CreateModel(
            name='Faculty',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, unique=True)),
                ('color', models.CharField(max_length=6)),
            ],
            options={
                'verbose_name': 'Faculty',
                'verbose_name_plural': 'Faculties',
            },
        ),
        migrations.CreateModel(
            name='Job',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=30, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('registration_number', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('last_name', models.CharField(max_length=30)),
                ('first_name', models.CharField(max_length=30)),
                ('birth_date', models.DateField(blank=True, null=True)),
                ('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
                ('active', models.BooleanField(default=True)),
                ('staff', models.BooleanField(default=False)),
                ('admin', models.BooleanField(default=False)),
                ('home_phone_number', models.CharField(blank=True, max_length=20)),
                ('mobile_phone_number', models.CharField(blank=True, max_length=30)),
                ('username', models.CharField(blank=True, max_length=255, null=True, unique=True, verbose_name='username')),
                ('network', models.ManyToManyField(related_name='_user_network_+', to='authentication.User')),
            ],
            options={
                'verbose_name': 'User',
                'verbose_name_plural': 'Users',
            },
        ),
        migrations.CreateModel(
            name='Enterprise',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='authentication.User')),
                ('logo', models.ImageField(blank=True, upload_to='enterprise_image/%Y/%m/%d/')),
                ('office', models.CharField(max_length=30)),
                ('address', models.TextField()),
                ('description', models.CharField(blank=True, max_length=300)),
            ],
            options={
                'abstract': False,
            },
            bases=('authentication.user',),
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('status', models.CharField(choices=[('annonce', 'an annonce'), ('reply', 'a reply'), ('message', 'a message')], default='message', max_length=20)),
                ('seen', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to='contenttypes.ContentType')),
                ('receiver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notification_receiver', to='authentication.User')),
            ],
            options={
                'verbose_name': 'Notification',
                'verbose_name_plural': 'Notifications',
                'ordering': ['-created'],
            },
            bases=(models.Model, authentication.models.ContentTypeToGetModel),
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('topic', models.CharField(choices=[('GE', 'General'), ('GR', 'Greeting'), ('DI', 'Dislike'), ('LI', 'Like')], default='GE', max_length=2)),
                ('content', models.TextField()),
                ('publication_date', models.DateField(auto_now_add=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='authentication.User')),
            ],
            options={
                'verbose_name': 'Message',
                'verbose_name_plural': 'Messages',
            },
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='authentication.User')),
                ('year', models.IntegerField()),
                ('campus', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='authentication.Campus')),
                ('faculty', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='authentication.Faculty')),
            ],
            options={
                'abstract': False,
            },
            bases=('authentication.user',),
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='authentication.User')),
                ('office', models.CharField(max_length=30)),
                ('campus', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='authentication.Campus')),
                ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='authentication.Job')),
            ],
            options={
                'abstract': False,
            },
            bases=('authentication.user',),
        ),
    ]
コード例 #11
0
ファイル: 0001_initial.py プロジェクト: adichopra11/nuroxo
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(db_index=True, max_length=255, unique=True)),
                ('email', models.CharField(max_length=255, unique=True)),
                ('first_name', models.CharField(blank=True, max_length=255)),
                ('last_name', models.CharField(blank=True, max_length=255)),
                ('phone_number', models.CharField(blank=True, max_length=15)),
                ('profession', models.CharField(blank=True, max_length=255)),
                ('father', models.CharField(blank=True, max_length=255)),
                ('mother', models.CharField(blank=True, max_length=255)),
                ('next_of_kin', models.CharField(blank=True, max_length=255)),
                ('emergency_contact',
                 models.CharField(blank=True, max_length=15)),
                ('blood_group', models.CharField(blank=True, max_length=3)),
                ('address', models.TextField(blank=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', authentication.models.UserManager()),
            ],
        ),
    ]
コード例 #12
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('last_active',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('bio', models.TextField(blank=True, max_length=500,
                                         null=True)),
                ('phone',
                 models.TextField(blank=True, max_length=100, null=True)),
                ('image',
                 models.ImageField(
                     blank=True,
                     upload_to=authentication.models.User.upload_to)),
                ('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', authentication.models.UserManager()),
            ],
        ),
    ]