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

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='RBCUser',
            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(blank=True, max_length=50, null=True, unique=True, verbose_name='username')),
                ('first_name', models.CharField(max_length=50, verbose_name='first_name')),
                ('middle_name', models.CharField(blank=True, max_length=50, null=True, verbose_name='middle_name')),
                ('last_name', models.CharField(blank=True, max_length=50, null=True, verbose_name='last_name')),
                ('year', models.IntegerField(choices=[(2, '2nd'), (3, '3rd'), (4, '4th')], null=True, verbose_name='year')),
                ('room_number', models.IntegerField(choices=[(101, '101'), (102, '102'), (103, '103'), (202, '202'), (211, '211')], null=True, verbose_name='room_number')),
                ('active', models.BooleanField(default=False, verbose_name='active')),
                ('staff', models.BooleanField(default=False, verbose_name='staff')),
                ('admin', models.BooleanField(default=False, verbose_name='admin')),
                ('authenticated', models.BooleanField(default=False, verbose_name='authenticated')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', Account.models.RBCUserManager()),
            ],
        ),
    ]
コード例 #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('username',
                 models.CharField(default='abc',
                                  max_length=30,
                                  unique=True,
                                  verbose_name='Username')),
                ('fullname',
                 models.CharField(default='ABC XYZ',
                                  max_length=100,
                                  verbose_name='Full Name')),
                ('email',
                 models.EmailField(default='*****@*****.**',
                                   max_length=100,
                                   verbose_name='Email Address')),
                ('phone',
                 models.CharField(default='012-3456-7890',
                                  max_length=15,
                                  verbose_name='Phone Number')),
                ('photo',
                 models.ImageField(
                     blank=True,
                     storage=override_existing.OverrideExisting(),
                     upload_to=Account.models.photo_path,
                     verbose_name='Photo ID')),
                ('barcode',
                 models.ImageField(
                     blank=True,
                     storage=override_existing.OverrideExisting(),
                     upload_to=Account.models.barcode_path,
                     verbose_name='Barcode ID')),
                ('password',
                 models.CharField(default='pwd',
                                  max_length=80,
                                  verbose_name='Password')),
                ('realPassword',
                 models.CharField(default='pwd',
                                  max_length=30,
                                  verbose_name='Raw Password')),
                ('dateSignUp',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Date Signed Up')),
                ('lastLogin',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Last Time Login')),
                ('isAdmin',
                 models.BooleanField(default=False,
                                     verbose_name='Administrator access')),
                ('isStaff',
                 models.BooleanField(default=False,
                                     verbose_name='Staff access')),
                ('isActive',
                 models.BooleanField(default=True, verbose_name='Activated')),
            ],
            options={
                'db_table': 'account_table',
            },
            managers=[
                ('object', django.db.models.manager.Manager()),
            ],
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('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(db_index=True,
                                   max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('mobile',
                 models.CharField(blank=True,
                                  max_length=20,
                                  verbose_name='mobile number')),
                ('image',
                 models.ImageField(height_field=100,
                                   upload_to='user/image/',
                                   verbose_name='Image',
                                   width_field=100)),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', Account.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Shop',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Name')),
                ('description',
                 models.CharField(max_length=50, verbose_name='Description')),
                ('image',
                 models.ImageField(upload_to='shop/image/',
                                   verbose_name='Image')),
                ('slug', models.SlugField(unique=True, verbose_name='Slug')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='Shop',
                                   related_query_name='Shop',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
            options={
                'verbose_name': 'shop',
                'verbose_name_plural': 'shops',
            },
        ),
        migrations.CreateModel(
            name='Email',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('subject',
                 models.CharField(max_length=150, verbose_name='Subject')),
                ('body', models.CharField(max_length=150,
                                          verbose_name='Body')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='Email',
                                   related_query_name='Email',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
            options={
                'verbose_name': 'email',
                'verbose_name_plural': 'emails',
            },
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('city', models.CharField(max_length=50, verbose_name='City')),
                ('street',
                 models.CharField(max_length=50, verbose_name='Street')),
                ('alley', models.CharField(max_length=50,
                                           verbose_name='Alley')),
                ('zip_code',
                 models.CharField(max_length=50, verbose_name='Zip_Code')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='Address',
                                   related_query_name='Address',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
            options={
                'verbose_name': 'address',
                'verbose_name_plural': 'addresses',
            },
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Batch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Name of Batch', max_length=50, verbose_name='Name')),
                ('branch', models.CharField(max_length=50, verbose_name='Branch')),
                ('year', models.IntegerField(verbose_name='Year')),
                ('semester', models.IntegerField(verbose_name='Semester')),
            ],
            options={
                'verbose_name': 'Batch',
                'verbose_name_plural': 'Batchs',
            },
        ),
        migrations.CreateModel(
            name='Result',
            fields=[
                ('code', models.SlugField(max_length=20, primary_key=True, serialize=False, unique=True, verbose_name='Paper Code')),
            ],
            options={
                'verbose_name': 'Result',
                'verbose_name_plural': 'Results',
            },
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('regno', models.IntegerField(primary_key=True, serialize=False, unique=True, verbose_name='Registartion Number')),
                ('name', models.CharField(help_text="Student's Name", max_length=120, verbose_name='Name')),
                ('email', models.EmailField(help_text="Studnet's Student", max_length=254, unique=True, verbose_name='Email')),
                ('phone', models.CharField(help_text="Student's phone number", max_length=10, unique=True, validators=[Account.models.phoneVerify], verbose_name='Phone')),
                ('active', models.BooleanField(default=False, verbose_name='Active')),
                ('auth', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='studentAuth', to=settings.AUTH_USER_MODEL, verbose_name="Student's Auth")),
                ('batch', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='batchs', to='Account.Batch', verbose_name='Batch')),
            ],
            options={
                'verbose_name': 'Student',
                'verbose_name_plural': 'Students',
            },
        ),
        migrations.CreateModel(
            name='Studentexam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mark', models.IntegerField(default=0, verbose_name='Mark')),
                ('result', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Account.Result', verbose_name='Examination')),
                ('student', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='Account.Student', verbose_name='Student')),
            ],
        ),
        migrations.AddField(
            model_name='result',
            name='students',
            field=models.ManyToManyField(related_name='studExam', through='Account.Studentexam', to='Account.Student', verbose_name='Students'),
        ),
    ]
コード例 #5
0
ファイル: 0001_initial.py プロジェクト: SIBU99/serverCVKM
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='ExpertApply',
            fields=[
                ('applicant_id',
                 models.UUIDField(default=uuid.uuid4,
                                  help_text="Expert Applicant's Unique ID",
                                  primary_key=True,
                                  serialize=False,
                                  unique=True,
                                  verbose_name="Expert's ID")),
                ('applicant_full_name',
                 models.CharField(help_text="Applicant's Full Name",
                                  max_length=100,
                                  verbose_name="Applicant's Fullname")),
                ('applicant_gender',
                 models.CharField(choices=[('female', 'Female'),
                                           ('male', 'Male'),
                                           ('other', 'Other')],
                                  default='male',
                                  max_length=20,
                                  verbose_name="Applicant's Gender")),
                ('applicant_status',
                 models.CharField(choices=[('pending', 'Pending'),
                                           ('accepted', 'Accepted'),
                                           ('rejected', 'Rejected')],
                                  default='pending',
                                  max_length=50,
                                  verbose_name='Status of the Application')),
                ('applicant_email',
                 models.EmailField(
                     help_text="Applicant's Digital Point Of Contact",
                     max_length=254,
                     unique=True,
                     verbose_name="Applicant's Email")),
                ('applicant_verified_email',
                 models.BooleanField(
                     default=False,
                     verbose_name="Applicant's Email Verified")),
                ('applicant_phone',
                 models.CharField(
                     max_length=10,
                     unique=True,
                     validators=[Account.models.validate_phone_number],
                     verbose_name="Applicant's Phone Number")),
                ('applicant_verified_phone',
                 models.BooleanField(
                     default=False,
                     verbose_name="Applicant's Phone Verified")),
                ('applicant_plot_no',
                 models.CharField(blank=True,
                                  default='',
                                  help_text="Applicant's Plot No",
                                  max_length=50,
                                  verbose_name='Plot No')),
                ('applicant_street',
                 models.CharField(help_text="Applicant's Street",
                                  max_length=150,
                                  verbose_name='Steet')),
                ('applicant_landmark',
                 models.CharField(blank=True,
                                  help_text="Applicant's Landmark",
                                  max_length=100,
                                  null=True,
                                  verbose_name='Landmark')),
                ('applicant_place',
                 models.CharField(help_text="Applicant's Palces",
                                  max_length=70,
                                  verbose_name='Places')),
                ('applicant_city',
                 models.CharField(help_text="Applicant's City",
                                  max_length=60,
                                  verbose_name='City')),
                ('applicant_state',
                 models.CharField(help_text="Applicant's State",
                                  max_length=70,
                                  verbose_name='State')),
                ('applicant_country',
                 models.CharField(help_text="Applicant's Counrty",
                                  max_length=50,
                                  verbose_name='Country')),
            ],
            options={
                'verbose_name': 'ExpertApply',
                'verbose_name_plural': 'ExpertApplys',
            },
        ),
        migrations.CreateModel(
            name='OTPTokenPhone',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('phone_number',
                 models.CharField(
                     max_length=10,
                     validators=[Account.models.validate_phone_number],
                     verbose_name='Phone Number')),
                ('token',
                 models.CharField(blank=True,
                                  max_length=4,
                                  verbose_name='Token')),
                ('purpose',
                 models.CharField(choices=[('vermob', 'Verification Mobile'),
                                           ('forpas', 'Forgot Password'),
                                           ('indent', 'Identify The Account')],
                                  default='ver',
                                  max_length=50,
                                  verbose_name='Purpose')),
                ('created_on',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created On')),
                ('change_request',
                 models.BooleanField(default=True,
                                     verbose_name='Regenerate Token')),
                ('token_used',
                 models.BooleanField(default=False,
                                     verbose_name='Token Used')),
                ('token_update',
                 models.BooleanField(default=False,
                                     verbose_name='Token Update')),
            ],
            options={
                'verbose_name': 'OTPToken',
                'verbose_name_plural': 'OTPTokens',
                'unique_together': {('phone_number', 'purpose')},
            },
        ),
        migrations.CreateModel(
            name='Others',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('other_full_name',
                 models.CharField(help_text="Expert's Full Name",
                                  max_length=100,
                                  verbose_name="Other's Fullname")),
                ('other_gender',
                 models.CharField(choices=[('female', 'Female'),
                                           ('male', 'Male'),
                                           ('other', 'Other')],
                                  default='male',
                                  max_length=20,
                                  verbose_name="Other's Gender")),
                ('other_email',
                 models.EmailField(
                     blank=True,
                     help_text="Other's Digital Point Of Contact",
                     max_length=254,
                     null=True,
                     verbose_name="Other's Email")),
                ('other_verified_email',
                 models.BooleanField(default=False,
                                     verbose_name="Other's Email Verified")),
                ('other_phone',
                 models.CharField(
                     max_length=10,
                     unique=True,
                     validators=[Account.models.validate_phone_number],
                     verbose_name="Other's Phone Number")),
                ('other_verified_phone',
                 models.BooleanField(default=False,
                                     verbose_name="Other's Phone Verified")),
                ('other_post',
                 models.TextField(verbose_name='Post Or Designation')),
                ('other_address',
                 models.TextField(verbose_name="Other's Address")),
                ('other_dp',
                 models.ImageField(upload_to=Account.models.other_dp_upload,
                                   verbose_name="Other's DP")),
                ('other_user_auth',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='other_account',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name="Other's Authentication Account")),
            ],
            options={
                'verbose_name': 'Others',
                'verbose_name_plural': 'Otherss',
            },
        ),
        migrations.CreateModel(
            name='Farmer',
            fields=[
                ('farmer_id',
                 models.UUIDField(default=uuid.uuid4,
                                  help_text="Farmer's Unique ID",
                                  primary_key=True,
                                  serialize=False,
                                  unique=True,
                                  verbose_name="Farmer's ID")),
                ('farmer_full_name',
                 models.CharField(help_text="Farmer's Full Name",
                                  max_length=100,
                                  verbose_name="Farmer's Fullname")),
                ('farmer_gender',
                 models.CharField(choices=[('female', 'Female'),
                                           ('male', 'Male'),
                                           ('other', 'Other')],
                                  default='male',
                                  max_length=20,
                                  verbose_name="Farmer's Gender")),
                ('farmer_email',
                 models.EmailField(
                     blank=True,
                     help_text="Farmer's Digital Point Of Contact",
                     max_length=254,
                     null=True,
                     verbose_name="Farmer's Email")),
                ('farmer_verified_email',
                 models.BooleanField(default=False,
                                     verbose_name="Farmer's Email Verified")),
                ('farmer_phone',
                 models.CharField(
                     max_length=10,
                     unique=True,
                     validators=[Account.models.validate_phone_number],
                     verbose_name="Farmer's Phone Number")),
                ('farmer_verified_phone',
                 models.BooleanField(default=False,
                                     verbose_name="Farmer's Phone Verified")),
                ('farmer_doj',
                 models.DateTimeField(
                     auto_now_add=True,
                     help_text='When did the farmer Created The Account',
                     verbose_name='D.O.J')),
                ('farmer_dp',
                 models.ImageField(default='dp/default.jpg',
                                   upload_to=Account.models.farmer_dp_upload,
                                   verbose_name="Farmer's Profile Pic")),
                ('farmer_plot_no',
                 models.CharField(blank=True,
                                  default='',
                                  help_text="Farmer's Plot No",
                                  max_length=50,
                                  verbose_name='Plot No')),
                ('farmer_street',
                 models.CharField(help_text="Farmer's Street",
                                  max_length=150,
                                  verbose_name='Steet')),
                ('farmer_landmark',
                 models.CharField(blank=True,
                                  help_text="Farmer's Landmark",
                                  max_length=100,
                                  null=True,
                                  verbose_name='Landmark')),
                ('farmer_place',
                 models.CharField(help_text="Farmer's Palces",
                                  max_length=70,
                                  verbose_name='Places')),
                ('farmer_city',
                 models.CharField(help_text="Farmer's City",
                                  max_length=60,
                                  verbose_name='City')),
                ('farmer_state',
                 models.CharField(help_text="Farmer's State",
                                  max_length=70,
                                  verbose_name='State')),
                ('farmer_country',
                 models.CharField(help_text="Farmer's Counrty",
                                  max_length=50,
                                  verbose_name='Country')),
                ('farmer_user_auth',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='farmer_account',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name="Famer's Authentication Account")),
            ],
            options={
                'verbose_name': 'Farmer',
                'verbose_name_plural': 'Farmers',
            },
        ),
        migrations.CreateModel(
            name='Expert',
            fields=[
                ('expert_id',
                 models.UUIDField(default=uuid.uuid4,
                                  help_text="Expert's Unique ID",
                                  primary_key=True,
                                  serialize=False,
                                  unique=True,
                                  verbose_name="Expert's ID")),
                ('expert_full_name',
                 models.CharField(help_text="Expert's Full Name",
                                  max_length=100,
                                  verbose_name="Expert's Fullname")),
                ('expert_gender',
                 models.CharField(choices=[('female', 'Female'),
                                           ('male', 'Male'),
                                           ('other', 'Other')],
                                  default='male',
                                  max_length=20,
                                  verbose_name="Expert's Gender")),
                ('expert_email',
                 models.EmailField(
                     help_text="Expert's Digital Point Of Contact",
                     max_length=254,
                     unique=True,
                     verbose_name="Expert's Email")),
                ('expert_verified_email',
                 models.BooleanField(default=False,
                                     verbose_name="Expert's Email Verified")),
                ('expert_phone',
                 models.CharField(
                     max_length=10,
                     unique=True,
                     validators=[Account.models.validate_phone_number],
                     verbose_name="Expert's Phone Number")),
                ('expert_verified_phone',
                 models.BooleanField(default=False,
                                     verbose_name="Expert's Phone Verified")),
                ('expert_plot_no',
                 models.CharField(blank=True,
                                  default='',
                                  help_text="Expert's Plot No",
                                  max_length=50,
                                  verbose_name='Plot No')),
                ('expert_street',
                 models.CharField(help_text="Expert's Street",
                                  max_length=150,
                                  verbose_name='Steet')),
                ('expert_landmark',
                 models.CharField(blank=True,
                                  help_text="Expert's Landmark",
                                  max_length=100,
                                  null=True,
                                  verbose_name='Landmark')),
                ('expert_place',
                 models.CharField(help_text="Expert's Palces",
                                  max_length=70,
                                  verbose_name='Places')),
                ('expert_city',
                 models.CharField(help_text="Expert's City",
                                  max_length=60,
                                  verbose_name='City')),
                ('expert_state',
                 models.CharField(help_text="Expert's State",
                                  max_length=70,
                                  verbose_name='State')),
                ('expert_country',
                 models.CharField(help_text="Expert's Counrty",
                                  max_length=50,
                                  verbose_name='Country')),
                ('expert_dp',
                 models.ImageField(default='dp/default.jpg',
                                   upload_to=Account.models.expert_dp_upload,
                                   verbose_name="Expert's Profile Pic")),
                ('expert_doj',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name="Expert's D.O.J.")),
                ('expert_user_auth',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='expert_account',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name="Famer's Authentication Account")),
            ],
            options={
                'verbose_name': 'Expert',
                'verbose_name_plural': 'Experts',
            },
        ),
        migrations.CreateModel(
            name='Document',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file',
                 models.FileField(upload_to=Account.models.document_upload,
                                  verbose_name='File Upload')),
                ('linked',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='linked_account_doc',
                                   to='Account.ExpertApply',
                                   verbose_name='')),
            ],
            options={
                'verbose_name': 'Document',
                'verbose_name_plural': 'Documents',
            },
        ),
    ]
コード例 #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Chat',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sender', models.IntegerField()),
                ('to', models.IntegerField()),
                ('date', models.DateTimeField(default=datetime.datetime.now)),
                ('message', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='ExtendedUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('userID', models.IntegerField()),
                ('ava',
                 models.ImageField(upload_to=Account.models.getAvaName)),
            ],
        ),
        migrations.CreateModel(
            name='Feedback',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user_id', models.IntegerField()),
                ('title', models.CharField(max_length=32)),
                ('text', models.CharField(max_length=1024)),
                ('time',
                 models.DateTimeField(blank=True,
                                      default=datetime.datetime.now)),
            ],
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=128)),
                ('short_description', models.CharField(max_length=128)),
                ('description', models.CharField(max_length=128)),
                ('time',
                 models.DateTimeField(blank=True,
                                      default=datetime.datetime.now)),
                ('image_src', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('surname', models.CharField(max_length=32)),
                ('login', models.CharField(max_length=32)),
                ('mail', models.EmailField(max_length=64)),
                ('passwd', models.CharField(max_length=256)),
            ],
        ),
    ]
コード例 #7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='DoctorProfileUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('profile_first_name', models.CharField(default='', max_length=30)),
                ('profile_last_name', models.CharField(default='', max_length=30)),
                ('hospital', models.CharField(default='None', max_length=50)),
                ('adress_hospital', models.CharField(default='None', max_length=60)),
                ('phone_number', models.IntegerField(default='1')),
                ('caption', models.TextField(default='', max_length=750)),
                ('profile_picture', models.ImageField(blank=True, null=True, upload_to='images/profile_images')),
                ('buletin_picture', models.ImageField(blank=True, null=True, upload_to='images/buletin')),
            ],
            options={
                'ordering': ('profile_first_name', 'profile_last_name'),
            },
        ),
        migrations.CreateModel(
            name='PacientProfileUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('profile_first_name', models.CharField(default='', max_length=30)),
                ('profile_last_name', models.CharField(default='', max_length=30)),
                ('cnp', models.IntegerField(default='0')),
                ('phone_number', models.CharField(default='1', max_length=20)),
                ('caption', models.TextField(default='', max_length=750)),
                ('blood_transfuzion', models.BooleanField(default=True)),
                ('profile_picture', models.ImageField(blank=True, null=True, upload_to='images/profile_images')),
                ('buletin_picture', models.ImageField(blank=True, null=True, upload_to='images/buletin')),
                ('analize', models.FileField(blank=True, null=True, upload_to='pdf_pacient/')),
            ],
            options={
                'ordering': ('profile_first_name', 'profile_last_name'),
            },
        ),
        migrations.CreateModel(
            name='CustomUser',
            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=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')),
                ('firstname', models.CharField(default='', max_length=20)),
                ('lastname', models.CharField(default='', max_length=20)),
                ('email', models.EmailField(default='', max_length=50, unique=True)),
                ('password', models.CharField(default='', max_length=255)),
                ('username', models.CharField(default='', max_length=50)),
                ('is_pacient', models.BooleanField(default='True', verbose_name='pacient')),
                ('is_doctor', models.BooleanField(default='False', verbose_name='doctor')),
                ('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', Account.models.MilanoUserManager()),
            ],
        ),
        migrations.AddField(
            model_name='pacientprofileuser',
            name='profile_pacient',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='doctorprofileuser',
            name='profile_doctor',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]