コード例 #1
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=255,
                                          null=True)),
                ('price', models.IntegerField()),
                ('description', models.TextField()),
                ('created_at', models.DateField()),
                ('num_pages', models.IntegerField()),
                ('genre', models.CharField(max_length=255)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Journal',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=255,
                                          null=True)),
                ('price', models.IntegerField()),
                ('description', models.TextField()),
                ('created_at', models.DateField()),
                ('type',
                 models.CharField(choices=[
                     (apps.models.TypeChoice['BU'], 'Bulet'),
                     (apps.models.TypeChoice['FO'], 'Food'),
                     (apps.models.TypeChoice['TR'], 'Travel'),
                     (apps.models.TypeChoice['SP'], 'Sport')
                 ],
                                  max_length=255)),
                ('publisher', models.CharField(max_length=255)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('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,
            },
        ),
    ]
コード例 #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='PatientData',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_of_reg', models.DateField(blank=True, null=True)),
                ('salutation',
                 models.CharField(blank=True,
                                  choices=[('Mr', 'Mr'), ('Mrs', 'Mrs'),
                                           ('Miss', 'Miss'), ('Ms', 'Ms'),
                                           ('Dr', 'Dr'), ('Baby', 'Baby'),
                                           ('Master', 'Master'),
                                           ('Sister', 'Sister'),
                                           ('Brother', 'Brother'),
                                           ('Father', 'Father')],
                                  max_length=50,
                                  null=True)),
                ('name', models.CharField(blank=True,
                                          max_length=255,
                                          null=True)),
                ('age', models.CharField(blank=True, max_length=255,
                                         null=True)),
                ('gender',
                 models.CharField(blank=True,
                                  choices=[('Male', 'Male'),
                                           ('Female', 'Female'),
                                           ('Transgender', 'Transgender')],
                                  max_length=50,
                                  null=True)),
                ('mobile_no',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('email',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('pa_address_detail',
                 models.TextField(blank=True, max_length=255, null=True)),
                ('pa_city',
                 models.CharField(blank=True,
                                  choices=[
                                      ('Mumbai', 'Mumbai'), ('Delhi', 'Delhi'),
                                      ('Bengaluru', 'Bengaluru'),
                                      ('Ahmedabad', 'Ahmedabad'),
                                      ('Hyderabad', 'Hyderabad'),
                                      ('Chennai', 'Chennai'),
                                      ('Kolkata', 'Kolkata'), ('Pune', 'Pune'),
                                      ('Jaipur', 'Jaipur'), ('Surat', 'Surat'),
                                      ('Lucknow', 'Lucknow'),
                                      ('Kanpur', 'Kanpur'),
                                      ('Nagpur', 'Nagpur'), ('Patna', 'Patna'),
                                      ('Indore', 'Indore'), ('Thane', 'Thane'),
                                      ('Bhopal', 'Bhopal'),
                                      ('Visakhapatnam', 'Visakhapatnam'),
                                      ('Vadodara', 'Vadodara'),
                                      ('Firozabad', 'Firozabad'),
                                      ('Ludhiana', 'Ludhiana'),
                                      ('Rajkot', 'Rajkot'), ('Agra', 'Agra'),
                                      ('Siliguri', 'Siliguri'),
                                      ('Nashik', 'Nashik'),
                                      ('Faridabad', 'Faridabad'),
                                      ('Patiala', 'Patiala'),
                                      ('Meerut', 'Meerut'),
                                      ('Kalyan-Dombivali', 'Kalyan-Dombivali'),
                                      ('Vasai-Virar', 'Vasai-Virar'),
                                      ('Varanasi', 'Varanasi'),
                                      ('Srinagar', 'Srinagar'),
                                      ('Dhanbad', 'Dhanbad'),
                                      ('Jodhpur', 'Jodhpur'),
                                      ('Amritsar', 'Amritsar'),
                                      ('Raipur', 'Raipur'),
                                      ('Allahabad', 'Allahabad'),
                                      ('Coimbatore', 'Coimbatore'),
                                      ('Jabalpur', 'Jabalpur'),
                                      ('Gwalior', 'Gwalior'),
                                      ('Vijayawada', 'Vijayawada'),
                                      ('Madurai', 'Madurai'),
                                      ('Guwahati', 'Guwahati'),
                                      ('Chandigarh', 'Chandigarh'),
                                      ('Hubli-Dharwad', 'Hubli-Dharwad'),
                                      ('Amroha', 'Amroha'),
                                      ('Moradabad', 'Moradabad'),
                                      ('Gurgaon', 'Gurgaon'),
                                      ('Aligarh', 'Aligarh'),
                                      ('Solapur', 'Solapur'),
                                      ('Ranchi', 'Ranchi'),
                                      ('Jalandhar', 'Jalandhar'),
                                      ('Tiruchirappalli', 'Tiruchirappalli'),
                                      ('Bhubaneswar', 'Bhubaneswar'),
                                      ('Salem', 'Salem'),
                                      ('Warangal', 'Warangal'),
                                      ('Mira-Bhayandar', 'Mira-Bhayandar'),
                                      ('Thiruvananthapuram',
                                       'Thiruvananthapuram'),
                                      ('Bhiwandi', 'Bhiwandi'),
                                      ('Saharanpur', 'Saharanpur')
                                  ],
                                  max_length=50,
                                  null=True)),
                ('address',
                 models.TextField(blank=True, max_length=255, null=True)),
                ('notes',
                 models.TextField(blank=True, max_length=255, null=True)),
            ],
            options={
                'verbose_name_plural': 'Patient Data',
            },
        ),
        migrations.CreateModel(
            name='PatientFiles',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('upload_files',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=apps.models.file_upload)),
                ('patient',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.PatientData',
                                   verbose_name='Patient')),
            ],
            options={
                'verbose_name_plural': 'Patient Files',
            },
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('category', models.CharField(max_length=200)),
                ('cat_img',
                 models.ImageField(default='category_image/default.png',
                                   help_text='Aspect ratio must be near 3;2',
                                   upload_to=apps.models.get_image_name)),
                ('time_per_ques_easy', models.IntegerField(default=20)),
                ('time_per_ques_medium', models.IntegerField(default=40)),
                ('time_per_ques_hard', models.IntegerField(default=60)),
            ],
        ),
        migrations.CreateModel(
            name='CompeteQuiz',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('question', models.TextField(max_length=1000)),
                ('option1', models.CharField(max_length=500)),
                ('option2', models.CharField(max_length=500)),
                ('option3', models.CharField(max_length=500)),
                ('option4', models.CharField(max_length=500)),
                ('answer', models.CharField(max_length=500)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Category')),
            ],
        ),
        migrations.CreateModel(
            name='EasyInstruction',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('instr', models.CharField(blank=True, max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='HardInstruction',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('instr', models.CharField(blank=True, max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='MediumInstruction',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('instr', models.CharField(blank=True, max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
                ('city', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
                ('profile_pic',
                 models.ImageField(
                     default='profile_pic/default.jpg',
                     upload_to=apps.models.upload_profile_image)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Quiz',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('level',
                 models.CharField(choices=[('easy', 'Easy'),
                                           ('medium', 'Medium'),
                                           ('hard', 'Hard')],
                                  default='NONE',
                                  max_length=20)),
                ('question', models.TextField(max_length=1000)),
                ('option1', models.CharField(max_length=500)),
                ('option2', models.CharField(max_length=500)),
                ('option3', models.CharField(max_length=500)),
                ('option4', models.CharField(max_length=500)),
                ('answer', models.CharField(max_length=500)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Score',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('all_score', models.FloatField(default=0.0)),
                ('easy_score', models.FloatField(default=0.0)),
                ('medium_score', models.FloatField(default=0.0)),
                ('hard_score', models.FloatField(default=0.0)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Category')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='category',
            name='easy_instr',
            field=models.ManyToManyField(to='apps.EasyInstruction'),
        ),
        migrations.AddField(
            model_name='category',
            name='hard_instr',
            field=models.ManyToManyField(to='apps.HardInstruction'),
        ),
        migrations.AddField(
            model_name='category',
            name='medium_instr',
            field=models.ManyToManyField(to='apps.MediumInstruction'),
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    dependencies = [
        ('apps', '0037_auto_20160921_1155'),
    ]

    operations = [
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(verbose_name='Текст')),
                ('text_src', models.TextField(verbose_name='Исходный текст')),
                ('time_created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('time_published', models.DateTimeField(editable=False, null=True, verbose_name='Дата публикации')),
                ('time_modified', models.DateTimeField(editable=False, null=True, verbose_name='Дата редактирования')),
                ('status', models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус')),
                ('supporters_num', models.PositiveIntegerField(default=0, verbose_name='Поддержка')),
                ('name', models.CharField(blank=True, max_length=90, verbose_name='Имя')),
                ('name_en', models.CharField(blank=True, max_length=90, verbose_name='Имя англ.')),
                ('aka', models.CharField(blank=True, max_length=255, verbose_name='Другие имена')),
            ],
            options={
                'verbose_name': 'Персона',
                'verbose_name_plural': 'Персоны',
            },
            bases=(apps.models.UtmReady, etc.models.InheritedModel, models.Model),
        ),
        migrations.AlterModelOptions(
            name='pep',
            options={'verbose_name': 'PEP', 'verbose_name_plural': 'PEP'},
        ),
        migrations.AlterModelOptions(
            name='user',
            options={'verbose_name': 'Пользователь', 'verbose_name_plural': 'Пользователи'},
        ),
        migrations.AlterField(
            model_name='article',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='book',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='community',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='discussion',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='event',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='externalresource',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='historicalarticle',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='historicalbook',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='historicalcommunity',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='historicaldiscussion',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='historicalevent',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='historicalplace',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='historicalreference',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='historicalvideo',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='pep',
            name='replaces',
            field=models.ManyToManyField(blank=True, related_name='replaced_by', to='apps.PEP', verbose_name='Поглощает'),
        ),
        migrations.AlterField(
            model_name='pep',
            name='requires',
            field=models.ManyToManyField(blank=True, related_name='used_by', to='apps.PEP', verbose_name='Зависит от'),
        ),
        migrations.AlterField(
            model_name='pep',
            name='superseded',
            field=models.ManyToManyField(blank=True, related_name='supersedes', to='apps.PEP', verbose_name='Заменено на'),
        ),
        migrations.AlterField(
            model_name='pep',
            name='versions',
            field=models.ManyToManyField(blank=True, related_name='peps', to='apps.Version', verbose_name='Версии Питона'),
        ),
        migrations.AlterField(
            model_name='place',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='reference',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='user',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='vacancy',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='version',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AlterField(
            model_name='video',
            name='status',
            field=models.PositiveIntegerField(choices=[(1, 'Черновик'), (2, 'Опубликован'), (5, 'К отложенной публикации'), (3, 'Удален'), (4, 'В архиве')], default=1, verbose_name='Статус'),
        ),
        migrations.AddField(
            model_name='person',
            name='last_editor',
            field=models.ForeignKey(blank=True, help_text='Пользователь, последним отредактировавший объект.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='person_editors', to=settings.AUTH_USER_MODEL, verbose_name='Редактор'),
        ),
        migrations.AddField(
            model_name='person',
            name='user',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='person', to=settings.AUTH_USER_MODEL, verbose_name='Пользователь'),
        ),
    ]
コード例 #5
0
class Migration(migrations.Migration):

    dependencies = [
        ('apps', '0041_auto_20170423_0536'),
    ]

    operations = [
        migrations.CreateModel(
            name='Summary',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('time_created',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Дата создания')),
                ('time_published',
                 models.DateTimeField(editable=False,
                                      null=True,
                                      verbose_name='Дата публикации')),
                ('time_modified',
                 models.DateTimeField(editable=False,
                                      null=True,
                                      verbose_name='Дата редактирования')),
                ('status',
                 models.PositiveIntegerField(choices=[
                     (1, 'Черновик'), (2, 'Опубликован'),
                     (5, 'К отложенной публикации'), (3, 'Удален'),
                     (4, 'В архиве')
                 ],
                                             default=1,
                                             verbose_name='Статус')),
                ('supporters_num',
                 models.PositiveIntegerField(default=0,
                                             verbose_name='Поддержка')),
                ('data_items',
                 models.TextField(verbose_name='Элементы сводки')),
                ('data_result',
                 models.TextField(verbose_name='Результат компоновки сводки')),
                ('last_editor',
                 models.ForeignKey(
                     blank=True,
                     help_text=
                     'Пользователь, последним отредактировавший объект.',
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='summary_editors',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='Редактор')),
                ('submitter',
                 models.ForeignKey(default=111,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='summary_submitters',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Добавил')),
            ],
            options={
                'ordering': ('-time_created', ),
                'verbose_name_plural': 'Сводки',
                'verbose_name': 'Сводка',
            },
            bases=(apps.models.UtmReady, models.Model),
        ),
    ]
コード例 #6
0
ファイル: 0001_initial.py プロジェクト: alic-xc/soundre
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='AudioModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=100,
                                  unique=True,
                                  verbose_name='audio new name')),
                ('hash',
                 models.UUIDField(blank=True,
                                  default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('path',
                 models.FileField(upload_to=apps.models.file_path,
                                  verbose_name='audio')),
                ('date_posted', models.DateTimeField(auto_now=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Audio',
                'ordering': ['date_posted'],
            },
        ),
        migrations.CreateModel(
            name='CoverPictureModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=100,
                                  unique=True,
                                  verbose_name='Cover Picture')),
                ('hash',
                 models.UUIDField(blank=True,
                                  default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('path',
                 models.ImageField(upload_to=apps.models.file_path,
                                   verbose_name='picture')),
                ('date_posted', models.DateTimeField(auto_now=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Cover Photo',
                'ordering': ['date_posted'],
            },
        ),
    ]
コード例 #7
0
ファイル: 0001_initial.py プロジェクト: handole/master_awal
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Akun',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdakun',
                 models.CharField(max_length=6, verbose_name='Kode akun')),
                ('nmakun',
                 models.CharField(max_length=100, verbose_name='Nama akun')),
                ('kdjenbel',
                 models.CharField(max_length=2,
                                  verbose_name='Kode Jenis Beli')),
                ('tahun',
                 models.IntegerField(choices=[(1980, 1980), (1981, 1981),
                                              (1982, 1982), (1983, 1983),
                                              (1984, 1984), (1985, 1985),
                                              (1986, 1986), (1987, 1987),
                                              (1988, 1988), (1989, 1989),
                                              (1990, 1990), (1991, 1991),
                                              (1992, 1992), (1993, 1993),
                                              (1994, 1994), (1995, 1995),
                                              (1996, 1996), (1997, 1997),
                                              (1998, 1998), (1999, 1999),
                                              (2000, 2000), (2001, 2001),
                                              (2002, 2002), (2003, 2003),
                                              (2004, 2004), (2005, 2005),
                                              (2006, 2006), (2007, 2007),
                                              (2008, 2008), (2009, 2009),
                                              (2010, 2010), (2011, 2011),
                                              (2012, 2012), (2013, 2013),
                                              (2014, 2014), (2015, 2015),
                                              (2016, 2016), (2017, 2017),
                                              (2018, 2018)],
                                     default=apps.models.current_year,
                                     verbose_name='Tahun')),
            ],
        ),
        migrations.CreateModel(
            name='Bulan',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdbulan',
                 models.CharField(max_length=2, verbose_name='Kode bulan')),
                ('nmbulan',
                 models.CharField(max_length=15, verbose_name='Nama Bulan')),
            ],
        ),
        migrations.CreateModel(
            name='Dept',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kddept',
                 models.CharField(max_length=3, verbose_name='Kode Dept')),
                ('nmdept',
                 models.CharField(max_length=70, verbose_name='Nama Dept')),
            ],
        ),
        migrations.CreateModel(
            name='Fungsi',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdfungsi',
                 models.CharField(max_length=2, verbose_name='Kode Fungsi')),
                ('nmfungsi',
                 models.CharField(max_length=30, verbose_name='Nama Fungsi')),
            ],
        ),
        migrations.CreateModel(
            name='Giat',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdsfungsi',
                 models.CharField(max_length=2, verbose_name='Kode SFungsi')),
                ('kdgiat',
                 models.CharField(max_length=4, verbose_name='Kode Giat')),
                ('nmgiat',
                 models.CharField(max_length=70, verbose_name='Nama Giat')),
                ('versi', models.CharField(max_length=25,
                                           verbose_name='Versi')),
                ('tahun',
                 models.IntegerField(choices=[(1980, 1980), (1981, 1981),
                                              (1982, 1982), (1983, 1983),
                                              (1984, 1984), (1985, 1985),
                                              (1986, 1986), (1987, 1987),
                                              (1988, 1988), (1989, 1989),
                                              (1990, 1990), (1991, 1991),
                                              (1992, 1992), (1993, 1993),
                                              (1994, 1994), (1995, 1995),
                                              (1996, 1996), (1997, 1997),
                                              (1998, 1998), (1999, 1999),
                                              (2000, 2000), (2001, 2001),
                                              (2002, 2002), (2003, 2003),
                                              (2004, 2004), (2005, 2005),
                                              (2006, 2006), (2007, 2007),
                                              (2008, 2008), (2009, 2009),
                                              (2010, 2010), (2011, 2011),
                                              (2012, 2012), (2013, 2013),
                                              (2014, 2014), (2015, 2015),
                                              (2016, 2016), (2017, 2017),
                                              (2018, 2018)],
                                     default=apps.models.current_year,
                                     verbose_name='Tahun Giat')),
                ('kdfungsi',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Fungsi',
                                   verbose_name='Kode Fungsi')),
            ],
        ),
        migrations.CreateModel(
            name='Kegiatan',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdkegiatan',
                 models.CharField(max_length=4, verbose_name='Kode Kegiatan')),
                ('nmkegiatan',
                 models.CharField(max_length=255,
                                  verbose_name='Nama Kegiatan')),
                ('keterangan', models.TextField()),
                ('budget',
                 models.DecimalField(decimal_places=2,
                                     max_digits=2,
                                     verbose_name='Budget')),
                ('status',
                 models.CharField(max_length=100, verbose_name='Status')),
                ('lft',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('created_by',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Created By')),
                ('parent_id',
                 mptt.fields.TreeForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='child',
                     to='apps.Kegiatan',
                     verbose_name='Child Id')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Kotam',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdkotama',
                 models.CharField(max_length=255, verbose_name='Kode Kotama')),
                ('nmkotama',
                 models.CharField(max_length=255, verbose_name='Nama Kotama')),
                ('kdkukotama',
                 models.CharField(max_length=255,
                                  verbose_name='Kode Kukotama')),
                ('kddept',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='kotam_dept',
                                   to='apps.Dept',
                                   verbose_name='Kode Dept')),
            ],
        ),
        migrations.CreateModel(
            name='Output',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdsfungsi',
                 models.CharField(max_length=2, verbose_name='Kode SFungsi')),
                ('kdoutput',
                 models.CharField(max_length=3, verbose_name='Kode Output')),
                ('nmoutput',
                 models.CharField(max_length=75, verbose_name='Nama Output')),
                ('kdfungsi',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Fungsi',
                                   verbose_name='Output')),
                ('kdgiat',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Giat',
                                   verbose_name='Kode Giat')),
                ('kdoutput1',
                 mptt.fields.TreeForeignKey(
                     max_length=2,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='apps.Output',
                     verbose_name='Kode Output 1')),
            ],
        ),
        migrations.CreateModel(
            name='Program',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdsfungsi',
                 models.CharField(max_length=2, verbose_name='Kode SFungsi')),
                ('kdprogram',
                 models.CharField(max_length=2, verbose_name='Kode Program')),
                ('nmprogram',
                 models.CharField(max_length=45, verbose_name='Nama Program')),
                ('tahun',
                 models.IntegerField(choices=[(1980, 1980), (1981, 1981),
                                              (1982, 1982), (1983, 1983),
                                              (1984, 1984), (1985, 1985),
                                              (1986, 1986), (1987, 1987),
                                              (1988, 1988), (1989, 1989),
                                              (1990, 1990), (1991, 1991),
                                              (1992, 1992), (1993, 1993),
                                              (1994, 1994), (1995, 1995),
                                              (1996, 1996), (1997, 1997),
                                              (1998, 1998), (1999, 1999),
                                              (2000, 2000), (2001, 2001),
                                              (2002, 2002), (2003, 2003),
                                              (2004, 2004), (2005, 2005),
                                              (2006, 2006), (2007, 2007),
                                              (2008, 2008), (2009, 2009),
                                              (2010, 2010), (2011, 2011),
                                              (2012, 2012), (2013, 2013),
                                              (2014, 2014), (2015, 2015),
                                              (2016, 2016), (2017, 2017),
                                              (2018, 2018)],
                                     default=apps.models.current_year,
                                     verbose_name='Tahun Program')),
                ('versi', models.CharField(max_length=20,
                                           verbose_name='Versi')),
                ('kdfungsi',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Fungsi',
                                   verbose_name='Kode Fungsi')),
            ],
        ),
        migrations.CreateModel(
            name='Satkr',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdsatkr',
                 models.CharField(max_length=2,
                                  verbose_name='Kode Satuan Kerja')),
                ('nmsatkr',
                 models.CharField(max_length=80,
                                  verbose_name='Nama Satuan Kerja')),
                ('kddept',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Dept',
                                   verbose_name='Kode Dept')),
                ('kdkotama',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Kotam',
                                   verbose_name='Kode Kotama')),
            ],
        ),
        migrations.CreateModel(
            name='Satkun',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdsakun',
                 models.IntegerField(null=True,
                                     verbose_name='Kode Satuan Kunjungan')),
                ('nmsakun',
                 models.CharField(max_length=255,
                                  verbose_name='Nama Satuan Kunjungan')),
                ('kddipa',
                 models.CharField(max_length=1, verbose_name='Kode Dipa')),
                ('kdakun',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='satkun_akun',
                                   to='apps.Akun',
                                   verbose_name='Kode Akun')),
                ('kdgiat',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='satkun_giat',
                                   to='apps.Giat',
                                   verbose_name='Kode Giat')),
                ('kdoutput',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='satkun_output',
                                   to='apps.Output',
                                   verbose_name='Kode Output')),
            ],
        ),
        migrations.CreateModel(
            name='Subsatkr',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdsubsatkr',
                 models.CharField(max_length=2,
                                  verbose_name='Kode Sub SatKer')),
                ('nmsubsatkr',
                 models.CharField(max_length=100,
                                  verbose_name='Nama SubSatkr')),
                ('kddept',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Dept',
                                   verbose_name='Kode Dept')),
                ('kdkotama',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Kotam',
                                   verbose_name='Kode Kotama')),
                ('kdsatkr',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Satkr',
                                   verbose_name='Kode Satuan Kerja')),
            ],
        ),
        migrations.CreateModel(
            name='Tingkat',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdtingkat', models.IntegerField(null=True)),
                ('pengguna', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdunit',
                 models.IntegerField(null=True, verbose_name='Kode Unit')),
                ('nmunit',
                 models.CharField(max_length=60, verbose_name='Nama Unit')),
                ('kddept',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='apps.Dept',
                                   verbose_name='Kode Dept')),
            ],
        ),
        migrations.CreateModel(
            name='Wasgiat',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('kdwasgiat',
                 models.CharField(max_length=2, verbose_name='Kode Wasgiat')),
                ('nmwasgiat',
                 models.CharField(max_length=30, verbose_name='Nama Wasgiat')),
            ],
        ),
        migrations.AddField(
            model_name='tingkat',
            name='kdwasgiat',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='apps.Wasgiat'),
        ),
        migrations.AddField(
            model_name='subsatkr',
            name='kdunit',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='apps.Unit',
                verbose_name='Kode Unit'),
        ),
        migrations.AddField(
            model_name='satkr',
            name='kdkusatker',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='apps.Satkun',
                verbose_name='Kode Kusatuan Kerja'),
        ),
        migrations.AddField(
            model_name='satkr',
            name='kdunit',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='apps.Unit',
                verbose_name='Kode Unit'),
        ),
        migrations.AddField(
            model_name='output',
            name='kdprogram',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='apps.Program',
                verbose_name='Kode Program'),
        ),
        migrations.AddField(
            model_name='kotam',
            name='kdunit',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='kotam_unit',
                to='apps.Unit',
                verbose_name='Kode Unit'),
        ),
        migrations.AddField(
            model_name='giat',
            name='kdprogram',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='apps.Program',
                verbose_name='Kode Program'),
        ),
    ]
コード例 #8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='部门名称')),
                ('count', models.IntegerField(default=0, verbose_name='人数')),
            ],
            options={
                'verbose_name': '部门管理',
                'verbose_name_plural': '部门管理',
                'db_table': 'user_department',
            },
        ),
        migrations.CreateModel(
            name='UserInfo',
            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')),
                ('email',
                 models.EmailField(db_index=True,
                                   max_length=255,
                                   unique=True,
                                   verbose_name='邮箱')),
                ('is_staff',
                 models.BooleanField(default=False,
                                     help_text='是否允许用户登录admin站点.',
                                     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')),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=32,
                                  verbose_name='名字')),
                ('phone',
                 models.CharField(blank=True,
                                  default=None,
                                  max_length=32,
                                  null=True,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          '^1[3-9]\\d{9}$')
                                  ],
                                  verbose_name='手机号码')),
                ('remarks',
                 models.TextField(blank=True,
                                  default=None,
                                  null=True,
                                  verbose_name='备注')),
                ('date_joined',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('department',
                 models.ForeignKey(blank=True,
                                   default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='users',
                                   to='apps.Department',
                                   verbose_name='部门')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': '用户管理',
                'verbose_name_plural': '用户管理',
                'db_table': 'user_userinfo',
            },
            managers=[
                ('objects', apps.models.UserManager()),
            ],
        ),
    ]