Exemplo n.º 1
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')),
                ('photo',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to=common.models.user_directory_path)),
                ('bio', models.TextField(blank=True, max_length=500,
                                         null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'User Profiles',
            },
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('ansible_api', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Cluster',
            fields=[
                ('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ansible_api.Project')),
                ('template', models.CharField(blank=True, default='', max_length=64)),
                ('current_task_id', models.CharField(blank=True, default='', max_length=128)),
                ('is_super', models.BooleanField(default=False)),
            ],
            bases=('ansible_api.project',),
        ),
        migrations.CreateModel(
            name='DeployExecution',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('timedelta', models.FloatField(default=0.0, null=True, verbose_name='Time')),
                ('state', models.CharField(choices=[('PENDING', 'Pending'), ('STARTED', 'Started'), ('SUCCESS', 'Success'), ('FAILURE', 'Failure'), ('RETRY', 'Retry')], default='PENDING', max_length=16)),
                ('num', models.IntegerField(default=1)),
                ('result_summary', common.models.JsonDictTextField(blank=True, default={}, null=True, verbose_name='Result summary')),
                ('result_raw', common.models.JsonDictTextField(blank=True, default={}, null=True, verbose_name='Result raw')),
                ('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Create time')),
                ('date_start', models.DateTimeField(null=True, verbose_name='Start time')),
                ('date_end', models.DateTimeField(null=True, verbose_name='End time')),
                ('operation', models.CharField(blank=True, choices=[('install', 'install'), ('upgrade', 'upgrade'), ('uninstall', 'uninstall')], default='install', max_length=128)),
                ('current_task', models.CharField(blank=True, default=None, max_length=128, null=True)),
                ('progress', models.FloatField(blank=True, default=0.0, max_length=64, null=True)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ansible_api.Project')),
            ],
            options={
                'ordering': ('-date_created',),
                'get_latest_by': 'date_created',
            },
        ),
        migrations.CreateModel(
            name='Host',
            fields=[
                ('name', models.CharField(max_length=256, validators=[django.core.validators.RegexValidator(message='Enter a valid name consisting of Unicode letters, numbers, underscores, or hyphens, or dot', regex='^[a-zA-Z0-9_\\-\\.]+$')])),
                ('ip', models.GenericIPAddressField(null=True)),
                ('port', models.IntegerField(default=22)),
                ('username', models.CharField(default='root', max_length=256)),
                ('password', common.models.EncryptCharField(blank=True, max_length=4096, null=True)),
                ('private_key', common.models.EncryptCharField(blank=True, max_length=8192, null=True)),
                ('vars', common.models.JsonDictTextField(default={})),
                ('meta', common.models.JsonDictTextField(default={})),
                ('comment', models.TextField(blank=True)),
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('memory', models.BigIntegerField(default=0)),
                ('os', models.CharField(default='', max_length=128)),
                ('os_version', models.CharField(default='', max_length=128)),
                ('cpu_core', models.IntegerField(default=0)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Node',
            fields=[
                ('host_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ansible_api.Host')),
                ('host', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='host', to='openshift_api.Host')),
            ],
            options={
                'abstract': False,
            },
            bases=('ansible_api.host',),
        ),
        migrations.CreateModel(
            name='Package',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=20, unique=True, verbose_name='Name')),
                ('meta', common.models.JsonTextField(blank=True, null=True, verbose_name='Meta')),
                ('date_created', models.DateTimeField(auto_now_add=True, verbose_name='Date created')),
            ],
            options={
                'verbose_name': 'Package',
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('ansible_api.group',),
        ),
        migrations.AddField(
            model_name='host',
            name='node',
            field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='node', to='openshift_api.Node'),
        ),
        migrations.AddField(
            model_name='cluster',
            name='package',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='openshift_api.Package'),
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('accounts', '0001_initial'),
        ('cases', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username', models.CharField(max_length=100, unique=True)),
                ('first_name', models.CharField(blank=True, max_length=150)),
                ('last_name', models.CharField(blank=True, max_length=150)),
                ('email', models.EmailField(max_length=255, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('date_joined',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date joined')),
                ('role',
                 models.CharField(choices=[('ADMIN', 'ADMIN'),
                                           ('USER', 'USER'),
                                           ('SALES', 'SALES'),
                                           ('MANAGER', 'MANAGER'),
                                           ('SALES MANAGER', 'SALES MANAGER')],
                                  max_length=50)),
                ('profile_pic',
                 models.FileField(blank=True,
                                  max_length=1000,
                                  null=True,
                                  upload_to=common.models.img_url)),
                ('has_sales_access', models.BooleanField(default=False)),
                ('has_marketing_access', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-is_active'],
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('address_line',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Address')),
                ('street',
                 models.CharField(blank=True,
                                  max_length=55,
                                  null=True,
                                  verbose_name='Street')),
                ('city',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='City')),
                ('state',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='State')),
                ('postcode',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='Post/Zip-code')),
                ('country',
                 models.CharField(
                     blank=True,
                     choices=[('GB', 'United Kingdom'), ('AF', 'Afghanistan'),
                              ('AX', 'Aland Islands'), ('AL', 'Albania'),
                              ('DZ', 'Algeria'), ('AS', 'American Samoa'),
                              ('AD', 'Andorra'), ('AO', 'Angola'),
                              ('AI', 'Anguilla'), ('AQ', 'Antarctica'),
                              ('AG', 'Antigua and Barbuda'),
                              ('AR', 'Argentina'), ('AM', 'Armenia'),
                              ('AW', 'Aruba'), ('AU', 'Australia'),
                              ('AT', 'Austria'), ('AZ', 'Azerbaijan'),
                              ('BS', 'Bahamas'), ('BH', 'Bahrain'),
                              ('BD', 'Bangladesh'), ('BB', 'Barbados'),
                              ('BY', 'Belarus'), ('BE', 'Belgium'),
                              ('BZ', 'Belize'), ('BJ', 'Benin'),
                              ('BM', 'Bermuda'), ('BT', 'Bhutan'),
                              ('BO', 'Bolivia'),
                              ('BA', 'Bosnia and Herzegovina'),
                              ('BW', 'Botswana'), ('BV', 'Bouvet Island'),
                              ('BR', 'Brazil'),
                              ('IO', 'British Indian Ocean Territory'),
                              ('BN', 'Brunei Darussalam'), ('BG', 'Bulgaria'),
                              ('BF', 'Burkina Faso'), ('BI', 'Burundi'),
                              ('KH', 'Cambodia'), ('CM', 'Cameroon'),
                              ('CA', 'Canada'), ('CV', 'Cape Verde'),
                              ('KY', 'Cayman Islands'),
                              ('CF', 'Central African Republic'),
                              ('TD', 'Chad'), ('CL', 'Chile'), ('CN', 'China'),
                              ('CX', 'Christmas Island'),
                              ('CC', 'Cocos (Keeling) Islands'),
                              ('CO', 'Colombia'), ('KM', 'Comoros'),
                              ('CG', 'Congo'),
                              ('CD', 'Congo, The Democratic Republic of the'),
                              ('CK', 'Cook Islands'), ('CR', 'Costa Rica'),
                              ('CI', "Cote d'Ivoire"), ('HR', 'Croatia'),
                              ('CU', 'Cuba'), ('CY', 'Cyprus'),
                              ('CZ', 'Czech Republic'), ('DK', 'Denmark'),
                              ('DJ', 'Djibouti'), ('DM', 'Dominica'),
                              ('DO', 'Dominican Republic'), ('EC', 'Ecuador'),
                              ('EG', 'Egypt'), ('SV', 'El Salvador'),
                              ('GQ', 'Equatorial Guinea'), ('ER', 'Eritrea'),
                              ('EE', 'Estonia'), ('ET', 'Ethiopia'),
                              ('FK', 'Falkland Islands (Malvinas)'),
                              ('FO', 'Faroe Islands'), ('FJ', 'Fiji'),
                              ('FI', 'Finland'), ('FR', 'France'),
                              ('GF', 'French Guiana'),
                              ('PF', 'French Polynesia'),
                              ('TF', 'French Southern Territories'),
                              ('GA', 'Gabon'), ('GM', 'Gambia'),
                              ('GE', 'Georgia'), ('DE', 'Germany'),
                              ('GH', 'Ghana'), ('GI', 'Gibraltar'),
                              ('GR', 'Greece'), ('GL', 'Greenland'),
                              ('GD', 'Grenada'), ('GP', 'Guadeloupe'),
                              ('GU', 'Guam'), ('GT', 'Guatemala'),
                              ('GG', 'Guernsey'), ('GN', 'Guinea'),
                              ('GW', 'Guinea-Bissau'), ('GY', 'Guyana'),
                              ('HT', 'Haiti'),
                              ('HM', 'Heard Island and McDonald Islands'),
                              ('VA', 'Holy See (Vatican City State)'),
                              ('HN', 'Honduras'), ('HK', 'Hong Kong'),
                              ('HU', 'Hungary'), ('IS', 'Iceland'),
                              ('IN', 'India'), ('ID', 'Indonesia'),
                              ('IR', 'Iran, Islamic Republic of'),
                              ('IQ', 'Iraq'), ('IE', 'Ireland'),
                              ('IM', 'Isle of Man'), ('IL', 'Israel'),
                              ('IT', 'Italy'), ('JM', 'Jamaica'),
                              ('JP', 'Japan'), ('JE', 'Jersey'),
                              ('JO', 'Jordan'), ('KZ', 'Kazakhstan'),
                              ('KE', 'Kenya'), ('KI', 'Kiribati'),
                              ('KP', "Korea, Democratic People's Republic of"),
                              ('KR', 'Korea, Republic of'), ('KW', 'Kuwait'),
                              ('KG', 'Kyrgyzstan'),
                              ('LA', "Lao People's Democratic Republic"),
                              ('LV', 'Latvia'), ('LB', 'Lebanon'),
                              ('LS', 'Lesotho'), ('LR', 'Liberia'),
                              ('LY', 'Libyan Arab Jamahiriya'),
                              ('LI', 'Liechtenstein'), ('LT', 'Lithuania'),
                              ('LU', 'Luxembourg'), ('MO', 'Macao'),
                              ('MK',
                               'Macedonia, The Former Yugoslav Republic of'),
                              ('MG', 'Madagascar'), ('MW', 'Malawi'),
                              ('MY', 'Malaysia'), ('MV', 'Maldives'),
                              ('ML', 'Mali'), ('MT', 'Malta'),
                              ('MH', 'Marshall Islands'), ('MQ', 'Martinique'),
                              ('MR', 'Mauritania'), ('MU', 'Mauritius'),
                              ('YT', 'Mayotte'), ('MX', 'Mexico'),
                              ('FM', 'Micronesia, Federated States of'),
                              ('MD', 'Moldova'), ('MC', 'Monaco'),
                              ('MN', 'Mongolia'), ('ME', 'Montenegro'),
                              ('MS', 'Montserrat'), ('MA', 'Morocco'),
                              ('MZ', 'Mozambique'), ('MM', 'Myanmar'),
                              ('NA', 'Namibia'), ('NR', 'Nauru'),
                              ('NP', 'Nepal'), ('NL', 'Netherlands'),
                              ('AN', 'Netherlands Antilles'),
                              ('NC', 'New Caledonia'), ('NZ', 'New Zealand'),
                              ('NI', 'Nicaragua'), ('NE', 'Niger'),
                              ('NG', 'Nigeria'), ('NU', 'Niue'),
                              ('NF', 'Norfolk Island'),
                              ('MP', 'Northern Mariana Islands'),
                              ('NO', 'Norway'), ('OM', 'Oman'),
                              ('PK', 'Pakistan'), ('PW', 'Palau'),
                              ('PS', 'Palestinian Territory, Occupied'),
                              ('PA', 'Panama'), ('PG', 'Papua New Guinea'),
                              ('PY', 'Paraguay'), ('PE', 'Peru'),
                              ('PH', 'Philippines'), ('PN', 'Pitcairn'),
                              ('PL', 'Poland'), ('PT', 'Portugal'),
                              ('PR', 'Puerto Rico'), ('QA', 'Qatar'),
                              ('RE', 'Reunion'), ('RO', 'Romania'),
                              ('RU', 'Russian Federation'), ('RW', 'Rwanda'),
                              ('BL', 'Saint Barthelemy'),
                              ('SH', 'Saint Helena'),
                              ('KN', 'Saint Kitts and Nevis'),
                              ('LC', 'Saint Lucia'), ('MF', 'Saint Martin'),
                              ('PM', 'Saint Pierre and Miquelon'),
                              ('VC', 'Saint Vincent and the Grenadines'),
                              ('WS', 'Samoa'), ('SM', 'San Marino'),
                              ('ST', 'Sao Tome and Principe'),
                              ('SA', 'Saudi Arabia'), ('SN', 'Senegal'),
                              ('RS', 'Serbia'), ('SC', 'Seychelles'),
                              ('SL', 'Sierra Leone'), ('SG', 'Singapore'),
                              ('SK', 'Slovakia'), ('SI', 'Slovenia'),
                              ('SB', 'Solomon Islands'), ('SO', 'Somalia'),
                              ('ZA', 'South Africa'),
                              ('GS',
                               'South Georgia and the South Sandwich Islands'),
                              ('ES', 'Spain'), ('LK', 'Sri Lanka'),
                              ('SD', 'Sudan'), ('SR', 'Suriname'),
                              ('SJ', 'Svalbard and Jan Mayen'),
                              ('SZ', 'Swaziland'), ('SE', 'Sweden'),
                              ('CH', 'Switzerland'),
                              ('SY', 'Syrian Arab Republic'),
                              ('TW', 'Taiwan, Province of China'),
                              ('TJ', 'Tajikistan'),
                              ('TZ', 'Tanzania, United Republic of'),
                              ('TH', 'Thailand'), ('TL', 'Timor-Leste'),
                              ('TG', 'Togo'), ('TK', 'Tokelau'),
                              ('TO', 'Tonga'), ('TT', 'Trinidad and Tobago'),
                              ('TN', 'Tunisia'), ('TR', 'Turkey'),
                              ('TM', 'Turkmenistan'),
                              ('TC', 'Turks and Caicos Islands'),
                              ('TV', 'Tuvalu'), ('UG', 'Uganda'),
                              ('UA', 'Ukraine'), ('AE',
                                                  'United Arab Emirates'),
                              ('US', 'United States'),
                              ('UM', 'United States Minor Outlying Islands'),
                              ('UY', 'Uruguay'), ('UZ', 'Uzbekistan'),
                              ('VU', 'Vanuatu'), ('VE', 'Venezuela'),
                              ('VN', 'Viet Nam'),
                              ('VG', 'Virgin Islands, British'),
                              ('VI', 'Virgin Islands, U.S.'),
                              ('WF', 'Wallis and Futuna'),
                              ('EH', 'Western Sahara'), ('YE', 'Yemen'),
                              ('ZM', 'Zambia'), ('ZW', 'Zimbabwe')],
                     max_length=3,
                     null=True)),
            ],
        ),
        migrations.CreateModel(
            name='APISettings',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=1000)),
                ('apikey', models.CharField(blank=True, max_length=16)),
                ('website', models.URLField(default='', max_length=255)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ('-created_on', ),
            },
        ),
        migrations.CreateModel(
            name='Attachments',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file_name', models.CharField(max_length=60)),
                ('created_on',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created on')),
                ('attachment',
                 models.FileField(max_length=1001,
                                  upload_to='attachments/%Y/%m/')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment', models.CharField(max_length=255)),
                ('commented_on', models.DateTimeField(auto_now_add=True)),
                ('account',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='accounts_comments',
                                   to='accounts.Account')),
                ('case',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='cases',
                                   to='cases.Case')),
                ('commented_by',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('activation_key', models.CharField(max_length=50)),
                ('key_expires', models.DateTimeField()),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Google',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('google_id', models.CharField(default='', max_length=200)),
                ('google_url', models.CharField(default='', max_length=1000)),
                ('verified_email', models.CharField(default='',
                                                    max_length=200)),
                ('family_name', models.CharField(default='', max_length=200)),
                ('name', models.CharField(default='', max_length=200)),
                ('gender', models.CharField(default='', max_length=10)),
                ('dob', models.CharField(default='', max_length=50)),
                ('given_name', models.CharField(default='', max_length=200)),
                ('email',
                 models.CharField(db_index=True, default='', max_length=200)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='google',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Document',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=1000, null=True)),
                ('document_file',
                 models.FileField(max_length=5000,
                                  upload_to=common.models.document_path)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('status',
                 models.CharField(choices=[('active', 'active'),
                                           ('inactive', 'inactive')],
                                  default='active',
                                  max_length=64)),
                ('created_by',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='document_uploaded',
                     to=settings.AUTH_USER_MODEL)),
                ('shared_to',
                 models.ManyToManyField(related_name='document_shared_to',
                                        to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created_on', ),
            },
        ),
        migrations.CreateModel(
            name='Comment_Files',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('updated_on', models.DateTimeField(auto_now_add=True)),
                ('comment_file',
                 models.FileField(default='',
                                  upload_to='comment_files',
                                  verbose_name='File')),
                ('comment',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='common.Comment')),
            ],
        ),
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=160)),
                ('text', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_starter', models.BooleanField(blank=True, default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Support',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('supported_post',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='supporters',
                                   to='common.Post')),
                ('supported_user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='supporters',
                                   to=settings.AUTH_USER_MODEL)),
                ('supporter',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='supports_made',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('is_organization', models.BooleanField(default=False)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='post',
            name='tags',
            field=models.ManyToManyField(related_name='users',
                                         to='common.Tag'),
        ),
        migrations.AddField(
            model_name='post',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to=common.models.image_upload_path)),
                ('order_in_post', models.IntegerField()),
                ('post',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='common.Post')),
            ],
        ),
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("auth", "0012_alter_user_first_name_max_length"),
    ]

    operations = [
        migrations.CreateModel(
            name="UserProfile",
            fields=[
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        primary_key=True,
                        serialize=False,
                        to="auth.user",
                    ),
                ),
                (
                    "avatar",
                    models.JSONField(
                        blank=True,
                        default=dict,
                        encoder=django.core.serializers.json.DjangoJSONEncoder,
                        validators=[common.models.validate_profile_avatar],
                    ),
                ),
                (
                    "phone_number",
                    phonenumber_field.modelfields.PhoneNumberField(
                        blank=True, max_length=128, region=None
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Ban",
            fields=[
                (
                    "receiver",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        primary_key=True,
                        serialize=False,
                        to="auth.user",
                    ),
                ),
                ("reason", models.CharField(blank=True, max_length=100, null=True)),
                ("created", models.DateTimeField(auto_now_add=True)),
                (
                    "creator",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="ban_creator",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
    ]
Exemplo n.º 6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('ansible_api', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Cluster',
            fields=[
                ('project_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ansible_api.Project')),
                ('template',
                 models.CharField(blank=True, default='', max_length=64)),
            ],
            bases=('ansible_api.project', ),
        ),
        migrations.CreateModel(
            name='DeployExecution',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('timedelta',
                 models.FloatField(default=0.0, null=True,
                                   verbose_name='Time')),
                ('state',
                 models.CharField(choices=[('PENDING', 'Pending'),
                                           ('STARTED', 'Started'),
                                           ('SUCCESS', 'Success'),
                                           ('FAILURE', 'Failure'),
                                           ('RETRY', 'Retry')],
                                  default='PENDING',
                                  max_length=16)),
                ('num', models.IntegerField(default=1)),
                ('result_summary',
                 common.models.JsonDictTextField(
                     blank=True,
                     default={},
                     null=True,
                     verbose_name='Result summary')),
                ('result_raw',
                 common.models.JsonDictTextField(blank=True,
                                                 default={},
                                                 null=True,
                                                 verbose_name='Result raw')),
                ('date_created',
                 models.DateTimeField(auto_now_add=True,
                                      null=True,
                                      verbose_name='Create time')),
                ('date_start',
                 models.DateTimeField(null=True, verbose_name='Start time')),
                ('date_end',
                 models.DateTimeField(null=True, verbose_name='End time')),
                ('project',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='ansible_api.Project')),
            ],
            options={
                'ordering': ('-date_created', ),
                'get_latest_by': 'date_created',
            },
        ),
        migrations.CreateModel(
            name='Package',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('name',
                 models.CharField(max_length=20,
                                  unique=True,
                                  verbose_name='Name')),
                ('meta',
                 common.models.JsonTextField(blank=True,
                                             null=True,
                                             verbose_name='Meta')),
                ('date_created',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Date created')),
            ],
            options={
                'verbose_name': 'Package',
            },
        ),
        migrations.CreateModel(
            name='Node',
            fields=[],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('ansible_api.host', ),
        ),
        migrations.CreateModel(
            name='Role',
            fields=[],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('ansible_api.group', ),
        ),
        migrations.AddField(
            model_name='cluster',
            name='package',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='openshift_api.Package'),
        ),
    ]
Exemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateField(auto_now_add=True, null=True)),
                ('modified_at', models.DateField(auto_now=True, null=True)),
                ('active', models.BooleanField(default=True)),
                ('name', models.CharField(max_length=150,
                                          verbose_name='_Name')),
            ],
            options={
                'verbose_name':
                'Department',
                'verbose_name_plural':
                'Departments',
                'permissions': (('change_between_departments',
                                 'Can change between Departments'), ),
            },
        ),
        migrations.CreateModel(
            name='OwnerGroup',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateField(auto_now_add=True, null=True)),
                ('modified_at', models.DateField(auto_now=True, null=True)),
                ('active', models.BooleanField(default=True)),
                ('name', models.CharField(max_length=80, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Owner group',
                'verbose_name_plural': 'Owner groups',
            },
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('created_at', models.DateField(auto_now_add=True, null=True)),
                ('modified_at', models.DateField(auto_now=True, null=True)),
                ('active', models.BooleanField(default=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     related_name='profile',
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('gender',
                 models.PositiveSmallIntegerField(blank=True,
                                                  choices=[(1, 'Male'),
                                                           (2, 'Female')],
                                                  null=True,
                                                  verbose_name='Gender')),
                ('avatar',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='',
                                   verbose_name='Avatar')),
                ('is_owner_admin', models.BooleanField(default=False)),
                ('email_is_verified',
                 models.BooleanField(default=False, editable=False)),
                ('forbidden_counter',
                 models.PositiveIntegerField(blank=True,
                                             default=0,
                                             editable=False)),
                ('department',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='members.Department')),
                ('group',
                 models.ManyToManyField(blank=True, to='members.OwnerGroup')),
                ('modified_by',
                 models.ForeignKey(
                     editable=False,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='userprofile_modified',
                     to=settings.AUTH_USER_MODEL)),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'User profile',
                'verbose_name_plural': 'User profiles',
            },
        ),
        migrations.AddField(
            model_name='ownergroup',
            name='modified_by',
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='ownergroup_modified',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='ownergroup',
            name='permission',
            field=models.ManyToManyField(
                blank=True,
                limit_choices_to={
                    'codename__in': [
                        'add_userprofile', 'delete_userprofile',
                        'view_userprofile', 'change_userprofile',
                        'change_between_departments', 'add_department',
                        'change_department', 'view_department',
                        'delete_department', 'add_ownergroup',
                        'change_ownergroup', 'view_ownergroup',
                        'delete_ownergroup'
                    ]
                },
                to='auth.Permission'),
        ),
        migrations.AddField(
            model_name='ownergroup',
            name='user',
            field=models.ForeignKey(editable=False,
                                    on_delete=common.models.SET_OWNER,
                                    related_name='ownergroup_created',
                                    to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='department',
            name='group',
            field=models.ManyToManyField(blank=True, to='members.OwnerGroup'),
        ),
        migrations.AddField(
            model_name='department',
            name='modified_by',
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='department_modified',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='department',
            name='user',
            field=models.ForeignKey(editable=False,
                                    on_delete=common.models.SET_OWNER,
                                    related_name='department_created',
                                    to=settings.AUTH_USER_MODEL),
        ),
    ]
Exemplo n.º 8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('ansible_api', '0002_auto_20190305_0555'),
    ]

    operations = [
        migrations.CreateModel(
            name='AuthTemplate',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='名称')),
                ('meta',
                 common.models.JsonTextField(blank=True,
                                             null=True,
                                             verbose_name='Meta')),
                ('date_created',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Date created')),
            ],
        ),
        migrations.CreateModel(
            name='Cluster',
            fields=[
                ('project_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ansible_api.Project')),
                ('template',
                 models.CharField(blank=True, default='', max_length=64)),
                ('status',
                 models.CharField(choices=[('RUNNING', 'running'),
                                           ('INSTALLING', 'installing'),
                                           ('UNKNOWN', 'unknown'),
                                           ('ERROR', 'error'),
                                           ('WARNING', 'warning')],
                                  default='UNKNOWN',
                                  max_length=128)),
                ('auth_template',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='kubeops_api.AuthTemplate')),
            ],
            bases=('ansible_api.project', ),
        ),
        migrations.CreateModel(
            name='DeployExecution',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('timedelta',
                 models.FloatField(default=0.0, null=True,
                                   verbose_name='Time')),
                ('state',
                 models.CharField(choices=[('PENDING', 'Pending'),
                                           ('STARTED', 'Started'),
                                           ('SUCCESS', 'Success'),
                                           ('FAILURE', 'Failure'),
                                           ('RETRY', 'Retry')],
                                  default='PENDING',
                                  max_length=16)),
                ('num', models.IntegerField(default=1)),
                ('result_summary',
                 common.models.JsonDictTextField(
                     blank=True,
                     default={},
                     null=True,
                     verbose_name='Result summary')),
                ('result_raw',
                 common.models.JsonDictTextField(blank=True,
                                                 default={},
                                                 null=True,
                                                 verbose_name='Result raw')),
                ('date_created',
                 models.DateTimeField(auto_now_add=True,
                                      null=True,
                                      verbose_name='Create time')),
                ('date_start',
                 models.DateTimeField(null=True, verbose_name='Start time')),
                ('date_end',
                 models.DateTimeField(null=True, verbose_name='End time')),
                ('operation', models.CharField(max_length=128)),
                ('progress', models.FloatField(default=0)),
                ('current_play',
                 models.CharField(default=None, max_length=512, null=True)),
            ],
            options={
                'ordering': ('-date_created', ),
                'get_latest_by': 'date_created',
            },
        ),
        migrations.CreateModel(
            name='Host',
            fields=[
                ('ip', models.GenericIPAddressField(null=True)),
                ('port', models.IntegerField(default=22)),
                ('username', models.CharField(default='root', max_length=256)),
                ('password',
                 common.models.EncryptCharField(blank=True,
                                                max_length=4096,
                                                null=True)),
                ('private_key',
                 common.models.EncryptCharField(blank=True,
                                                max_length=8192,
                                                null=True)),
                ('vars', common.models.JsonDictTextField(default={})),
                ('meta', common.models.JsonDictTextField(default={})),
                ('comment', models.TextField(blank=True)),
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('name',
                 models.CharField(
                     max_length=128,
                     unique=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             'Enter a valid name consisting of Unicode letters, numbers, underscores, or hyphens, or dot',
                             regex='^[a-zA-Z0-9_\\-\\.]+$')
                     ])),
            ],
            options={
                'ordering': ('name', ),
            },
        ),
        migrations.CreateModel(
            name='HostInfo',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('memory', models.BigIntegerField(default=0)),
                ('os', models.CharField(default='', max_length=128)),
                ('os_version', models.CharField(default='', max_length=128)),
                ('cpu_core', models.IntegerField(default=0)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('host',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='infos',
                                   to='kubeops_api.Host')),
            ],
            options={
                'get_latest_by': 'date_created',
            },
        ),
        migrations.CreateModel(
            name='Node',
            fields=[
                ('host_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ansible_api.Host')),
                ('host',
                 models.ForeignKey(default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='host',
                                   to='kubeops_api.Host')),
            ],
            options={
                'abstract': False,
            },
            bases=('ansible_api.host', ),
        ),
        migrations.CreateModel(
            name='Package',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('name',
                 models.CharField(max_length=20,
                                  unique=True,
                                  verbose_name='Name')),
                ('meta',
                 common.models.JsonTextField(blank=True,
                                             null=True,
                                             verbose_name='Meta')),
                ('date_created',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Date created')),
            ],
            options={
                'verbose_name': 'Package',
            },
        ),
        migrations.CreateModel(
            name='Setting',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('key', models.CharField(max_length=128)),
                ('value',
                 models.CharField(blank=True,
                                  default=None,
                                  max_length=255,
                                  null=True)),
                ('name', models.CharField(max_length=128)),
                ('helper', models.CharField(blank=True, max_length=255)),
                ('order', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Storage',
            fields=[
                ('project_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ansible_api.Project')),
                ('vars',
                 common.models.JsonDictTextField(blank=True,
                                                 default={},
                                                 null=True,
                                                 verbose_name='Vars')),
                ('status',
                 models.CharField(choices=[('RUNNING', 'running'),
                                           ('UNKNOWN', 'unknown'),
                                           ('ERROR', 'error'),
                                           ('CHECKING', 'checking')],
                                  default='UNKNOWN',
                                  max_length=128)),
            ],
            bases=('ansible_api.project', ),
        ),
        migrations.CreateModel(
            name='StorageNode',
            fields=[
                ('host_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='ansible_api.Host')),
                ('status',
                 models.CharField(choices=[('RUNNING', 'running'),
                                           ('UNKNOWN', 'unknown'),
                                           ('ERROR', 'error')],
                                  default='UNKNOWN',
                                  max_length=128)),
                ('message', models.TextField(default=None, null=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('ansible_api.host', ),
        ),
        migrations.CreateModel(
            name='StorageTemplate',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='名称')),
                ('meta', common.models.JsonDictTextField(blank=True,
                                                         null=True)),
                ('date_created',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Date created')),
            ],
        ),
        migrations.CreateModel(
            name='Volume',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(max_length=128)),
                ('size', models.CharField(max_length=16)),
            ],
            options={
                'ordering': ('size', ),
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('ansible_api.group', ),
        ),
        migrations.AddField(
            model_name='storage',
            name='nodes',
            field=models.ManyToManyField(to='kubeops_api.StorageNode'),
        ),
        migrations.AddField(
            model_name='storage',
            name='template',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='kubeops_api.StorageTemplate'),
        ),
        migrations.AddField(
            model_name='hostinfo',
            name='volumes',
            field=models.ManyToManyField(to='kubeops_api.Volume'),
        ),
        migrations.AddField(
            model_name='host',
            name='node',
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='node',
                to='kubeops_api.Node'),
        ),
        migrations.AddField(
            model_name='deployexecution',
            name='project',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='ansible_api.Project'),
        ),
        migrations.AddField(
            model_name='cluster',
            name='package',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='kubeops_api.Package'),
        ),
        migrations.AddField(
            model_name='cluster',
            name='persistent_storage',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='kubeops_api.Storage'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('common', '0003_auto_20200914_2129'),
    ]

    operations = [
        migrations.AddField(
            model_name='image',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True,
                                       default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='image',
            name='updated_at',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='profile',
            name='bio',
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='profile',
            name='website',
            field=models.CharField(blank=True, max_length=160, null=True),
        ),
        migrations.AddField(
            model_name='support',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True,
                                       default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='support',
            name='updated_at',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.CreateModel(
            name='UserImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(
                     upload_to=common.models.user_image_upload_path)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Exemplo n.º 10
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')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username', models.CharField(max_length=100, unique=True)),
                ('first_name', models.CharField(blank=True, max_length=150)),
                ('last_name', models.CharField(blank=True, max_length=150)),
                ('email', models.EmailField(max_length=255, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('date_joined',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date joined')),
                ('role',
                 models.CharField(choices=[('ADMIN', 'ADMIN'),
                                           ('CONSULTANT', 'CONSULTANT'),
                                           ('USER', 'USER')],
                                  max_length=50)),
                ('profile_pic',
                 models.FileField(blank=True,
                                  max_length=1000,
                                  null=True,
                                  upload_to=common.models.img_url)),
                ('has_sales_access', models.BooleanField(default=False)),
                ('has_marketing_access', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-is_active'],
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('address_line',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='Address')),
                ('street',
                 models.CharField(blank=True,
                                  max_length=55,
                                  null=True,
                                  verbose_name='Street')),
                ('city',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='City')),
                ('state',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='State')),
                ('postcode',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='Post/Zip-code')),
                ('country',
                 models.CharField(blank=True,
                                  choices=[('Botswana', 'Botswana')],
                                  max_length=20,
                                  null=True)),
            ],
        ),
        migrations.CreateModel(
            name='APISettings',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=1000)),
                ('apikey', models.CharField(blank=True, max_length=16)),
                ('website', models.URLField(default='', max_length=255)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ('-created_on', ),
            },
        ),
        migrations.CreateModel(
            name='Attachments',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file_name', models.CharField(max_length=60)),
                ('created_on',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created on')),
                ('attachment',
                 models.FileField(max_length=1001,
                                  upload_to='attachments/%Y/%m/')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment', models.CharField(max_length=255)),
                ('commented_on', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Comment_Files',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('updated_on', models.DateTimeField(auto_now_add=True)),
                ('comment_file',
                 models.FileField(default='',
                                  upload_to='comment_files',
                                  verbose_name='File')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('activation_key', models.CharField(max_length=50)),
                ('key_expires', models.DateTimeField()),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Google',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('google_id', models.CharField(default='', max_length=200)),
                ('google_url', models.CharField(default='', max_length=1000)),
                ('verified_email', models.CharField(default='',
                                                    max_length=200)),
                ('family_name', models.CharField(default='', max_length=200)),
                ('name', models.CharField(default='', max_length=200)),
                ('gender', models.CharField(default='', max_length=10)),
                ('dob', models.CharField(default='', max_length=50)),
                ('given_name', models.CharField(default='', max_length=200)),
                ('email',
                 models.CharField(db_index=True, default='', max_length=200)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='google',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Document',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=1000, null=True)),
                ('document_file',
                 models.FileField(max_length=5000,
                                  upload_to=common.models.document_path)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('status',
                 models.CharField(choices=[('active', 'active'),
                                           ('inactive', 'inactive')],
                                  default='active',
                                  max_length=64)),
                ('created_by',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='document_uploaded',
                     to=settings.AUTH_USER_MODEL)),
                ('shared_to',
                 models.ManyToManyField(related_name='document_shared_to',
                                        to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created_on', ),
            },
        ),
    ]
Exemplo n.º 11
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')),
                ('first_name',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('last_name',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('email',
                 models.EmailField(blank=True, max_length=254, null=True)),
                ('avatar',
                 models.ImageField(
                     blank=True,
                     height_field='height_field',
                     null=True,
                     upload_to=common.models.profile_img_upload_location,
                     width_field='width_field')),
                ('height_field',
                 models.IntegerField(blank=True, default=0, null=True)),
                ('width_field',
                 models.IntegerField(blank=True, default=0, null=True)),
                ('language',
                 models.CharField(
                     blank=True,
                     choices=[('af', 'Afrikaans'), ('ar', 'Arabic'),
                              ('ast', 'Asturian'), ('az', 'Azerbaijani'),
                              ('bg', 'Bulgarian'), ('be', 'Belarusian'),
                              ('bn', 'Bengali'), ('br', 'Breton'),
                              ('bs', 'Bosnian'), ('ca', 'Catalan'),
                              ('cs', 'Czech'), ('cy', 'Welsh'),
                              ('da', 'Danish'), ('de', 'German'),
                              ('el', 'Greek'), ('en', 'English'),
                              ('en-au', 'Australian English'),
                              ('en-gb', 'British English'),
                              ('eo', 'Esperanto'), ('es', 'Spanish'),
                              ('es-ar', 'Argentinian Spanish'),
                              ('es-co', 'Colombian Spanish'),
                              ('es-mx', 'Mexican Spanish'),
                              ('es-ni', 'Nicaraguan Spanish'),
                              ('es-ve', 'Venezuelan Spanish'),
                              ('et', 'Estonian'), ('eu', 'Basque'),
                              ('fa', 'Persian'), ('fi', 'Finnish'),
                              ('fr', 'French'), ('fy', 'Frisian'),
                              ('ga', 'Irish'), ('gd', 'Scottish Gaelic'),
                              ('gl', 'Galician'), ('he', 'Hebrew'),
                              ('hi', 'Hindi'), ('hr', 'Croatian'),
                              ('hu', 'Hungarian'), ('ia', 'Interlingua'),
                              ('id', 'Indonesian'), ('io', 'Ido'),
                              ('is', 'Icelandic'), ('it', 'Italian'),
                              ('ja', 'Japanese'), ('ka', 'Georgian'),
                              ('kk', 'Kazakh'), ('km', 'Khmer'),
                              ('kn', 'Kannada'), ('ko', 'Korean'),
                              ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'),
                              ('lv', 'Latvian'), ('mk', 'Macedonian'),
                              ('ml', 'Malayalam'), ('mn', 'Mongolian'),
                              ('mr', 'Marathi'), ('my', 'Burmese'),
                              ('nb', 'Norwegian Bokmal'), ('ne', 'Nepali'),
                              ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'),
                              ('os', 'Ossetic'), ('pa', 'Punjabi'),
                              ('pl', 'Polish'), ('pt', 'Portuguese'),
                              ('pt-br', 'Brazilian Portuguese'),
                              ('ro', 'Romanian'), ('ru', 'Russian'),
                              ('sk', 'Slovak'), ('sl', 'Slovenian'),
                              ('sq', 'Albanian'), ('sr', 'Serbian'),
                              ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'),
                              ('sw', 'Swahili'), ('ta', 'Tamil'),
                              ('te', 'Telugu'), ('th', 'Thai'),
                              ('tr', 'Turkish'), ('tt', 'Tatar'),
                              ('udm', 'Udmurt'), ('uk', 'Ukrainian'),
                              ('ur', 'Urdu'), ('vi', 'Vietnamese'),
                              ('zh-hans', 'Simplified Chinese'),
                              ('zh-hant', 'Traditional Chinese')],
                     default='ru',
                     max_length=10,
                     null=True)),
                ('phone', models.CharField(blank=True,
                                           max_length=25,
                                           null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]