class Migration(migrations.Migration):

    dependencies = [
        ('resource_inventory', '0004_auto_20181017_1532'),
        ('api', '0003_auto_20190102_1956'),
    ]

    operations = [
        migrations.CreateModel(
            name='SnapshotConfig',
            fields=[
                ('taskconfig_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.TaskConfig')),
                ('image', models.IntegerField(null=True)),
                ('dashboard_id', models.IntegerField()),
                ('host', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='resource_inventory.Host')),
            ],
            bases=('api.taskconfig',),
        ),
        migrations.CreateModel(
            name='SnapshotRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id', models.CharField(default=api.models.get_task_uuid, max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
                ('config', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.SnapshotConfig')),
                ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Job')),
                ('snapshot', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resource_inventory.Image')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
Пример #2
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('api', '0007_auto_20200728_1917'),
    ]

    operations = [
        migrations.AlterField(
            model_name='gamer',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                primary_key=True,
                serialize=False,
                to=settings.AUTH_USER_MODEL,
                validators=[api.models.unique_individual_group]),
        ),
        migrations.AlterField(
            model_name='point',
            name='user',
            field=models.CharField(default='',
                                   max_length=200,
                                   validators=[api.models.username_exists]),
        ),
        migrations.AlterUniqueTogether(
            name='point',
            unique_together={('user', 'given_by')},
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Assistant',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            bases=('api.user', ),
            managers=[
                ('objects', api.models.UserManager()),
            ],
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Installer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('business_year', models.TextField(blank=True, default=api.models.get_business_year_default, verbose_name='사업년도')),
                ('teams', models.CharField(blank=True, default='', max_length=100, verbose_name='시공 목록')),
                ('is_active', models.BooleanField(default=True, verbose_name='활성화 여부')),
                ('user', models.OneToOneField(limit_choices_to={'groups__name': '시공'}, on_delete=django.db.models.deletion.CASCADE, related_name='installer', to=settings.AUTH_USER_MODEL, verbose_name='시공 연결된 아이디')),
            ],
            options={
                'verbose_name': '시공',
                'verbose_name_plural': '시공 목록',
            },
        ),
        migrations.AddField(
            model_name='post',
            name='installer',
            field=models.ForeignKey(blank=True, help_text='시공', null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Installer', verbose_name='시공'),
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

    dependencies = [
        ('api', '0009_auto_20190408_1431'),
    ]

    operations = [
        migrations.AddField(
            model_name='researchgroup',
            name='contact_person',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Profile'),
        ),
        migrations.AddField(
            model_name='researchgroup',
            name='img_1',
            field=models.ImageField(blank=True, null=True, upload_to=api.models.path),
        ),
        migrations.AddField(
            model_name='researchgroup',
            name='img_2',
            field=models.ImageField(blank=True, null=True, upload_to=api.models.path),
        ),
        migrations.AddField(
            model_name='researchgroup',
            name='img_3',
            field=models.ImageField(blank=True, null=True, upload_to=api.models.path),
        ),
        migrations.AddField(
            model_name='researchgroup',
            name='img_4',
            field=models.ImageField(blank=True, null=True, upload_to=api.models.path),
        ),
    ]
Пример #6
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('title', models.CharField(blank=True, default='', max_length=100)),
                ('slug', models.SlugField(editable=False, max_length=100, primary_key=True, serialize=False)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['date_created'],
            },
        ),
        migrations.CreateModel(
            name='Faculty',
            fields=[
                ('title', models.CharField(blank=True, default='', max_length=100)),
                ('slug', models.SlugField(editable=False, max_length=100, primary_key=True, serialize=False)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['date_created'],
            },
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, default='', max_length=100)),
                ('year', models.PositiveIntegerField(choices=[(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), (2019, 2019), (2020, 2020)], default=2020, validators=[django.core.validators.MinValueValidator(1984), api.models.max_value_current_year])),
                ('month', models.PositiveIntegerField(choices=[('1', 'January'), ('2', 'February'), ('3', 'March'), ('4', 'April'), ('5', 'May'), ('6', 'June'), ('7', 'July'), ('8', 'August'), ('9', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)])),
                ('day', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(31)])),
                ('start_time', models.TimeField(blank=True)),
                ('end_time', models.TimeField(blank=True)),
                ('slug', models.SlugField(editable=False, max_length=100)),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='api.department')),
                ('faculty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='api.faculty')),
            ],
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('faculty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.faculty')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='department',
            name='faculty',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='department', to='api.faculty'),
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Pokemon',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('code', models.CharField(max_length=32)),
                ('cp', models.IntegerField()),
                ('hp', models.IntegerField()),
                ('stardust', models.IntegerField()),
                ('attack', models.IntegerField()),
                ('defense', models.IntegerField()),
                ('stigmata', models.IntegerField()),
                ('percent', models.FloatField()),
                ('app1', models.IntegerField()),
                ('app2S', models.BooleanField()),
                ('app2A', models.BooleanField()),
                ('app2D', models.BooleanField()),
                ('app3', models.IntegerField()),
                ('team', models.CharField(max_length=32)),
                ('ref',
                 models.CharField(default=api.models._createRef,
                                  max_length=32,
                                  unique=True)),
                ('user',
                 models.ForeignKey(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')),
                ('team', models.CharField(blank=True, max_length=32,
                                          null=True)),
                ('level', models.IntegerField(blank=True, null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(max_length=58, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nickName', models.CharField(max_length=20)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('img', models.ImageField(blank=True, null=True, upload_to=api.models.upload_avatar_path)),
                ('userProfile', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='userProfile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('img', models.ImageField(blank=True, null=True, upload_to=api.models.upload_post_path)),
                ('liked', models.ManyToManyField(blank=True, related_name='liked', to=settings.AUTH_USER_MODEL)),
                ('userPost', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='userPost', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=100)),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Post')),
                ('userComment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='userComment', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #9
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('img',
                 models.ImageField(max_length=200,
                                   upload_to=api.models.get_file_path)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='images',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'images',
            },
        ),
        migrations.CreateModel(
            name='Result',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('datetime', models.DateTimeField(auto_now_add=True)),
                ('text', models.TextField(blank=True, null=True)),
                ('image',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='result',
                     to='api.Image')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='results',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'results',
                'ordering': ['-datetime'],
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('api', '0002_auto_20201205_1537'),
    ]

    operations = [
        migrations.CreateModel(
            name='Staff',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('faculty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.faculty')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='staff_of', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AlterField(
            model_name='examination',
            name='month',
            field=models.PositiveIntegerField(choices=[(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)]),
        ),
        migrations.AlterField(
            model_name='examination',
            name='year',
            field=models.PositiveIntegerField(choices=[(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), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], default=2020, validators=[django.core.validators.MinValueValidator(1984), api.models.max_value_current_year]),
        ),
        migrations.AlterField(
            model_name='facultyevent',
            name='month',
            field=models.PositiveIntegerField(choices=[(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)]),
        ),
        migrations.AlterField(
            model_name='facultyevent',
            name='year',
            field=models.PositiveIntegerField(choices=[(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), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], default=2020, validators=[django.core.validators.MinValueValidator(1984), api.models.max_value_current_year]),
        ),
        migrations.AlterField(
            model_name='universityevent',
            name='month',
            field=models.PositiveIntegerField(choices=[(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)]),
        ),
        migrations.AlterField(
            model_name='universityevent',
            name='year',
            field=models.PositiveIntegerField(choices=[(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), (2019, 2019), (2020, 2020), (2021, 2021), (2022, 2022), (2023, 2023)], default=2020, validators=[django.core.validators.MinValueValidator(1984), api.models.max_value_current_year]),
        ),
        migrations.DeleteModel(
            name='Employee',
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('api', '0003_auto_20170316_1827'),
    ]

    operations = [
        migrations.AlterField(
            model_name='name',
            name='hash_1',
            field=models.CharField(default=api.models._createHash, max_length=30, unique=True),
        ),
        migrations.AlterField(
            model_name='userprofile',
            name='user',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
Пример #12
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')),
                ('item', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('task', models.CharField(max_length=100)),
                ('description', models.CharField(max_length=300)),
                ('criteria', models.CharField(max_length=100)),
                ('status', models.CharField(choices=[('1', 'Not started'), ('2', 'On going'), ('3', 'Done')], default='1', max_length=40)),
                ('estimate', models.IntegerField(validators=[django.core.validators.MinValueValidator(0)])),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.category')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owner', to=settings.AUTH_USER_MODEL)),
                ('responsible', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='responsible', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('img', models.ImageField(blank=True, null=True, upload_to=api.models.upload_avatar_path)),
                ('user_profile', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='user_profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #13
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bio', models.TextField(max_length=100)),
                ('profile_picture',
                 models.ImageField(upload_to=api.models.profile_picture_path)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image', models.ImageField(upload_to=api.models.image_path)),
                ('userprofile',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.UserProfile')),
            ],
        ),
    ]
Пример #14
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='ChatMessage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('message', models.CharField(max_length=200)),
                ('sender', models.CharField(max_length=200)),
                ('timestamp', models.TimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code',
                 models.CharField(default=api.models.gen_rand_str,
                                  max_length=30)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #15
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('email', models.EmailField(max_length=50, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FrameBrand',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('item', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='WheelBrand',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('item', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nickName', models.CharField(max_length=20)),
                ('frame',
                 models.CharField(default='bianchi', max_length=30,
                                  null=True)),
                ('component',
                 models.CharField(choices=[('1', 'SHIMANO'), ('2', 'SRAM'),
                                           ('3', 'CAMPAGNOLO')],
                                  default='1',
                                  max_length=40)),
                ('compo',
                 models.CharField(default='slam', max_length=30, null=True)),
                ('wheel',
                 models.CharField(default='spinergy', max_length=30,
                                  null=True)),
                ('purchase', models.DateField(null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('img',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=api.models.upload_path)),
                ('frameBrand',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.framebrand')),
                ('liked',
                 models.ManyToManyField(blank=True,
                                        related_name='liked',
                                        to=settings.AUTH_USER_MODEL)),
                ('userPro',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='userPro',
                     to=settings.AUTH_USER_MODEL)),
                ('wheelBrand',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.wheelbrand')),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('message', models.CharField(max_length=140)),
                ('receiver',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='receiver',
                                   to=settings.AUTH_USER_MODEL)),
                ('sender',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sender',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='FriendRequest',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('approved', models.BooleanField(default=False)),
                ('askFrom',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='askFrom',
                                   to=settings.AUTH_USER_MODEL)),
                ('askTo',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='askTo',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('askFrom', 'askTo')},
            },
        ),
    ]
Пример #16
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('number',
                 models.PositiveSmallIntegerField(
                     default=api.models.Game.random_number)),
                ('question_limit',
                 models.PositiveSmallIntegerField(default=5)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('number',
                 models.PositiveSmallIntegerField(blank=True, null=True)),
                ('type', models.CharField(max_length=10)),
                ('is_correct', models.BooleanField()),
                ('game',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='questions',
                                   to='api.Game')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Guess',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('number', models.PositiveSmallIntegerField()),
                ('game',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='api.Game')),
            ],
            options={
                'verbose_name_plural': 'guesses',
            },
        ),
    ]
Пример #17
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('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')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('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')),
                ('division',
                 models.CharField(blank=True,
                                  choices=[
                                      ('KCH', 'KUCHING'),
                                      ('SMH', 'KOTA SAMARAHAN'),
                                      ('SER', 'SERIAN'), ('SAM', 'SRI AMAN'),
                                      ('BTG', 'BETONG'), ('SKI', 'SARIKEI'),
                                      ('SBU', 'SIBU'), ('MKH', 'MUKAH'),
                                      ('BIN', 'BINTULU'), ('KPT', 'KAPIT'),
                                      ('MRI', 'MIRI'), ('LBG', 'LIMBANG')
                                  ],
                                  max_length=3,
                                  null=True)),
                ('fullname', models.CharField(blank=True, max_length=50)),
                ('is_farmer', models.BooleanField(default=False)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='OfficeLocation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('contact_number', models.CharField(blank=True,
                                                    max_length=50)),
                ('address', models.CharField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='StaffProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('div_office',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.OfficeLocation')),
                ('user',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='staff_profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='FarmerProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('contact_number', models.CharField(max_length=100)),
                ('address', models.TextField(blank=True, max_length=20)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('user',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='farmer_profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Farm',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('farm_gps',
                 models.CharField(blank=True, max_length=30, null=True)),
                ('farm_condition',
                 models.CharField(blank=True,
                                  choices=[('B', 'BERBUKIT'), ('R', 'RATA'),
                                           ('L', 'LAIN-LAIN')],
                                  max_length=6,
                                  null=True)),
                ('farm_area',
                 models.CharField(blank=True,
                                  choices=[('H1', 'Kurang daripada 1 hektar'),
                                           ('H2', '1–20 hektar'),
                                           ('H3', '21–40 hektar'),
                                           ('H4', '41–60 hektar'),
                                           ('H5', '61–80 hektar'),
                                           ('H6', '81–100 hektar'),
                                           ('H7', 'Lebih daripada 100 hektar')
                                           ],
                                  max_length=2,
                                  null=True)),
                ('variety',
                 models.CharField(blank=True, max_length=30, null=True)),
                ('vine_number',
                 models.CharField(blank=True,
                                  choices=[('VN1', '100 atau kurang'),
                                           ('VN2', '101–300'),
                                           ('VN3', '301–500'),
                                           ('VN4', '501–700'),
                                           ('VN5', '701–900'),
                                           ('VN6', '901–1100'),
                                           ('VN7', '1101–1300'),
                                           ('VN8', '1301–1500'),
                                           ('VN9', '1501–1700'),
                                           ('VN10', '1701–1900'),
                                           ('VN11', '1901–2100'),
                                           ('VN12', '2101–2300'),
                                           ('VN13', '2301–2500'),
                                           ('VN14', '2501–2700'),
                                           ('VN15', '2701–2900'),
                                           ('VN16', '2901–3100'),
                                           ('VN17', '3101–3300'),
                                           ('VN18', '3301–3500'),
                                           ('VN19', '3501–3700'),
                                           ('VN20', '3701–3900'),
                                           ('VN21', '3901–4000'),
                                           ('VN22', 'Lebih daripada 4000')],
                                  max_length=5,
                                  null=True)),
                ('farm_age', models.CharField(blank=True, max_length=20)),
                ('slug', models.SlugField(blank=True)),
                ('user',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='farmer_farm',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Case',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('case_gps',
                 models.CharField(blank=True, max_length=30, null=True)),
                ('vine_no', models.CharField(blank=True, max_length=20)),
                ('vine_age', models.CharField(blank=True, max_length=20)),
                ('case_start_date', models.DateField()),
                ('case_subject', models.CharField(blank=True, max_length=200)),
                ('case_descriptions',
                 models.CharField(blank=True, max_length=200)),
                ('vine_part', models.CharField(blank=True, max_length=50)),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=api.models.upload_location)),
                ('case_reported_datetime',
                 models.DateTimeField(auto_now=True, null=True)),
                ('case_status',
                 models.CharField(blank=True,
                                  choices=[('open', 'Buka'),
                                           ('processing', 'Sedang diproses'),
                                           ('closed', 'Tutup')],
                                  max_length=20)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('farmer',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #18
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('from_amount',
                 models.DecimalField(decimal_places=2, max_digits=10)),
                ('to_amount',
                 models.DecimalField(decimal_places=2, max_digits=10)),
                ('from_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='output',
                     to=settings.AUTH_USER_MODEL)),
                ('to_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='input',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=10, unique=True)),
                ('is_base', models.BooleanField(default=False)),
                ('multiple',
                 models.IntegerField(default=api.models.get_multiple)),
                ('rate',
                 models.DecimalField(decimal_places=2,
                                     default=api.models.get_multiple,
                                     max_digits=10)),
                ('base',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='currencies',
                     to='api.Currency')),
            ],
        ),
        migrations.CreateModel(
            name='Balance',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2,
                                               max_digits=10)),
                ('currency',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.Currency')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #19
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='MyUser',
            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')),
                ('email',
                 models.EmailField(max_length=255,
                                   unique=True,
                                   verbose_name=b'email address')),
                ('first_name', models.CharField(blank=True, max_length=40)),
                ('last_name', models.CharField(blank=True, max_length=40)),
                ('default_tzid', models.CharField(max_length=50)),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Application',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('url', models.CharField(max_length=70)),
                ('logo', models.FileField(blank=True, null=True,
                                          upload_to=b'')),
                ('client_id',
                 models.CharField(db_index=True,
                                  default=api.models.generate_client_id,
                                  max_length=100,
                                  unique=True)),
                ('client_secret',
                 models.CharField(blank=True,
                                  db_index=True,
                                  default=api.models.generate_client_secret,
                                  max_length=255)),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ApplicationUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('scope', models.TextField(null=True)),
                ('application',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Application')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('profile_id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('contact_number', models.CharField(max_length=20)),
                ('status_message',
                 models.CharField(blank=True,
                                  help_text=b'Twitter style status message',
                                  max_length=144,
                                  null=True)),
                ('bio', models.TextField(blank=True, null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #20
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Days',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('day', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Verification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.IntegerField(default=0)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('reference', models.CharField(max_length=150)),
                ('authorization_code', models.CharField(max_length=150)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserWallet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('available_balance', models.FloatField(default=0.0)),
                ('total_balance', models.FloatField(default=0.0)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='StudentSchedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('from_hour', models.CharField(max_length=10)),
                ('from_minute', models.CharField(max_length=10)),
                ('to_hour', models.CharField(max_length=10)),
                ('to_minute', models.CharField(max_length=10)),
                ('days', models.ManyToManyField(blank=True, null=True, to='api.Days')),
                ('tutor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tutor', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_requested', models.DateTimeField(auto_now_add=True)),
                ('declined', models.BooleanField(default=False)),
                ('accepted', models.BooleanField(default=False)),
                ('requester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pending_requests', to=settings.AUTH_USER_MODEL)),
                ('schedule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.StudentSchedule')),
                ('tutor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requests', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rate', models.DecimalField(decimal_places=2, default=0.0, max_digits=5)),
                ('tutor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ratings_tutor', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(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')),
                ('profile_pic', models.ImageField(blank=True, default='default/default.jpg', null=True, upload_to=api.models.get_upload_file_name)),
                ('credentials', models.FileField(blank=True, null=True, upload_to=api.models.get_upload_file_name_credentials)),
                ('video', models.FileField(blank=True, null=True, upload_to=api.models.get_upload_file_name_videos)),
                ('desc', models.TextField(blank=True, max_length=255, null=True)),
                ('field', models.CharField(blank=True, max_length=255)),
                ('hourly_rate', models.CharField(default=0, max_length=10000000)),
                ('major_course', models.CharField(blank=True, max_length=255, null=True)),
                ('other_courses', models.CharField(blank=True, max_length=255, null=True)),
                ('state', models.CharField(blank=True, max_length=255)),
                ('address', models.CharField(blank=True, max_length=255, null=True)),
                ('rating', models.ManyToManyField(blank=True, to='api.Rating')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CreditCardInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('card_holder_name', models.CharField(max_length=255, null=True)),
                ('card_number', models.CharField(max_length=255, null=True)),
                ('cvv', models.CharField(max_length=255, null=True)),
                ('expiry_month', models.IntegerField(null=True)),
                ('expiry_year', models.IntegerField(null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='BankInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bank_name', models.CharField(blank=True, max_length=255, null=True)),
                ('account_name', models.CharField(blank=True, max_length=255, null=True)),
                ('account_number', models.IntegerField(blank=True, null=True)),
                ('routing_number', models.IntegerField(blank=True, null=True)),
                ('social_security_number', models.IntegerField(blank=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #21
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('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')),
                ('full_name',
                 models.CharField(max_length=100, verbose_name='ФИО')),
                ('role',
                 models.CharField(choices=[('client', 'Клиент'),
                                           ('manager', 'Менеджер')],
                                  default='client',
                                  max_length=10,
                                  verbose_name='Роль пользователя')),
                ('mailing_address',
                 models.CharField(max_length=100,
                                  verbose_name='Адрес доставки')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='Email')),
                ('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': 'Пользователи',
            },
            managers=[
                ('objects', api.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
            options={
                'verbose_name': 'Корзина',
                'verbose_name_plural': 'Корзины',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('vendor_code',
                 models.CharField(max_length=100,
                                  unique=True,
                                  verbose_name='артикул')),
                ('name',
                 models.CharField(max_length=64, verbose_name='наименование')),
                ('retail_price',
                 models.PositiveSmallIntegerField(
                     verbose_name='Розничная цена')),
                ('purchase_price',
                 models.PositiveSmallIntegerField(
                     verbose_name='Цена закупки')),
            ],
            options={
                'verbose_name': 'Товар',
                'verbose_name_plural': 'Товары',
            },
        ),
        migrations.CreateModel(
            name='ProductsInOrder',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantity',
                 models.PositiveSmallIntegerField(
                     verbose_name='количество товара')),
                ('order',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='корзина',
                                   to='api.order')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='товар',
                                   to='api.product')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='products',
            field=models.ManyToManyField(through='api.ProductsInOrder',
                                         to='api.Product',
                                         verbose_name='Товары в корзине'),
        ),
        migrations.AddField(
            model_name='order',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='order',
                to=settings.AUTH_USER_MODEL),
        ),
    ]
Пример #22
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('booking', '__first__'),
        ('resource_inventory', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='AccessRelation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id',
                 models.CharField(default=api.models.get_task_uuid,
                                  max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HostHardwareRelation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id',
                 models.CharField(default=api.models.get_task_uuid,
                                  max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
                ('host',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='resource_inventory.Host')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HostNetworkRelation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id',
                 models.CharField(default=api.models.get_task_uuid,
                                  max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
                ('host',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='resource_inventory.Host')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Job',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('delta', models.TextField()),
                ('complete', models.BooleanField(default=False)),
                ('booking',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='booking.Booking')),
            ],
        ),
        migrations.CreateModel(
            name='OpnfvApiConfig',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('installer', models.CharField(max_length=100)),
                ('scenario', models.CharField(max_length=100)),
                ('delta', models.TextField()),
                ('roles',
                 models.ManyToManyField(to='resource_inventory.Host')),
            ],
        ),
        migrations.CreateModel(
            name='SoftwareRelation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status', models.IntegerField(default=0)),
                ('task_id',
                 models.CharField(default=api.models.get_task_uuid,
                                  max_length=37)),
                ('lab_token', models.CharField(default='null', max_length=50)),
                ('message', models.TextField(default='')),
                ('job',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Job')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TaskConfig',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='AccessConfig',
            fields=[
                ('taskconfig_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='api.TaskConfig')),
                ('access_type', models.CharField(max_length=50)),
                ('revoke', models.BooleanField(default=False)),
                ('context', models.TextField(default='')),
                ('delta', models.TextField()),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            bases=('api.taskconfig', ),
        ),
        migrations.CreateModel(
            name='HardwareConfig',
            fields=[
                ('taskconfig_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='api.TaskConfig')),
                ('image', models.CharField(default='defimage',
                                           max_length=100)),
                ('power', models.CharField(default='off', max_length=100)),
                ('hostname',
                 models.CharField(default='hostname', max_length=100)),
                ('ipmi_create', models.BooleanField(default=False)),
                ('delta', models.TextField()),
            ],
            bases=('api.taskconfig', ),
        ),
        migrations.CreateModel(
            name='NetworkConfig',
            fields=[
                ('taskconfig_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='api.TaskConfig')),
                ('delta', models.TextField()),
                ('interfaces',
                 models.ManyToManyField(to='resource_inventory.Interface')),
            ],
            bases=('api.taskconfig', ),
        ),
        migrations.CreateModel(
            name='SoftwareConfig',
            fields=[
                ('taskconfig_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='api.TaskConfig')),
                ('opnfv',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.OpnfvApiConfig')),
            ],
            bases=('api.taskconfig', ),
        ),
        migrations.AddField(
            model_name='hostnetworkrelation',
            name='job',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
        ),
        migrations.AddField(
            model_name='hosthardwarerelation',
            name='job',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
        ),
        migrations.AddField(
            model_name='accessrelation',
            name='job',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='api.Job'),
        ),
        migrations.AddField(
            model_name='softwarerelation',
            name='config',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.SoftwareConfig'),
        ),
        migrations.AddField(
            model_name='hostnetworkrelation',
            name='config',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.NetworkConfig'),
        ),
        migrations.AddField(
            model_name='hosthardwarerelation',
            name='config',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.HardwareConfig'),
        ),
        migrations.AddField(
            model_name='accessrelation',
            name='config',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.AccessConfig'),
        ),
    ]
Пример #23
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  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')),
                ('is_donor_or_hospital', models.BooleanField(default=False)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', api.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email_confirmed', models.BooleanField(default=False)),
                ('phone_number', models.CharField(max_length=15, null=True)),
                ('location', models.CharField(max_length=15, null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Donor',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bloodGroup', models.CharField(max_length=2, null=True)),
                ('birth_date', models.DateField(null=True)),
                ('last_donated_date', models.DateField(null=True)),
                ('capable', models.BooleanField(default=True)),
                ('gender', models.CharField(max_length=10, null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #24
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='LoggedInUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('session_key',
                 models.CharField(blank=True, max_length=32, null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='logged_in_user',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SavedRequests',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ip', models.CharField(max_length=30)),
                ('time', models.DateTimeField(auto_now=True)),
                ('explorer', models.CharField(max_length=50)),
                ('auth', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Twit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateField()),
                ('title', models.CharField(default='title', max_length=100)),
                ('body', models.CharField(max_length=300)),
            ],
        ),
        migrations.CreateModel(
            name='TwitterUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('avatar',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=api.models.user_directory_path)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='twit',
            name='owner',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='api.TwitterUser'),
        ),
    ]
Пример #25
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Action',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='ActionsTaken',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('organization',
                 models.CharField(choices=[('NTLS', 'National Society'),
                                           ('PNS', 'Foreign Society'),
                                           ('FDRN', 'Federation')],
                                  max_length=4)),
                ('summary', models.TextField(blank=True)),
                ('actions', models.ManyToManyField(to='api.Action')),
            ],
        ),
        migrations.CreateModel(
            name='Appeal',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('aid', models.CharField(max_length=20)),
                ('name', models.CharField(max_length=100)),
                ('atype',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.AppealType)),
                ('status',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.AppealStatus)),
                ('code', models.CharField(max_length=20, null=True)),
                ('sector', models.CharField(blank=True, max_length=100)),
                ('num_beneficiaries', models.IntegerField(default=0)),
                ('amount_requested',
                 models.DecimalField(decimal_places=2,
                                     default=0.0,
                                     max_digits=12)),
                ('amount_funded',
                 models.DecimalField(decimal_places=2,
                                     default=0.0,
                                     max_digits=12)),
                ('start_date', models.DateTimeField(null=True)),
                ('end_date', models.DateTimeField(null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ('-end_date', '-start_date'),
            },
        ),
        migrations.CreateModel(
            name='AppealDocument',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField()),
                ('name', models.CharField(max_length=100)),
                ('document',
                 models.FileField(blank=True,
                                  null=True,
                                  storage=api.storage.AzureStorage(),
                                  upload_to=api.models.appeal_document_path)),
                ('document_url', models.URLField(blank=True)),
                ('appeal',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Appeal')),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('iso', models.CharField(max_length=2, null=True)),
                ('society_name', models.TextField(blank=True)),
                ('society_url', models.URLField(blank=True)),
            ],
            options={
                'verbose_name_plural': 'Countries',
                'ordering': ('name', ),
            },
        ),
        migrations.CreateModel(
            name='DisasterType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('summary', models.TextField()),
            ],
            options={
                'ordering': ('name', ),
            },
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('summary', models.TextField(blank=True)),
                ('num_affected', models.IntegerField(blank=True, null=True)),
                ('alert_level',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.AlertLevel)),
                ('glide', models.CharField(blank=True, max_length=18)),
                ('disaster_start_date', models.DateTimeField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('auto_generated', models.BooleanField(default=False)),
                ('countries', models.ManyToManyField(to='api.Country')),
                ('dtype',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='api.DisasterType')),
            ],
            options={
                'verbose_name': 'Emergency',
                'verbose_name_plural': 'Emergencies',
                'ordering': ('-disaster_start_date', ),
            },
        ),
        migrations.CreateModel(
            name='EventContact',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ctype', models.CharField(blank=True, max_length=100)),
                ('name', models.CharField(max_length=100)),
                ('title', models.CharField(max_length=300)),
                ('email', models.CharField(max_length=300)),
                ('event',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Event')),
            ],
        ),
        migrations.CreateModel(
            name='FieldReport',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rid',
                 models.CharField(blank=True,
                                  editable=False,
                                  max_length=100,
                                  null=True)),
                ('summary', models.TextField(blank=True)),
                ('description', models.TextField(blank=True, default='')),
                ('status', models.IntegerField(default=0)),
                ('request_assistance', models.BooleanField(default=False)),
                ('num_injured', models.IntegerField(blank=True, null=True)),
                ('num_dead', models.IntegerField(blank=True, null=True)),
                ('num_missing', models.IntegerField(blank=True, null=True)),
                ('num_affected', models.IntegerField(blank=True, null=True)),
                ('num_displaced', models.IntegerField(blank=True, null=True)),
                ('num_assisted', models.IntegerField(blank=True, null=True)),
                ('num_localstaff', models.IntegerField(blank=True, null=True)),
                ('num_volunteers', models.IntegerField(blank=True, null=True)),
                ('num_expats_delegates',
                 models.IntegerField(blank=True, null=True)),
                ('gov_num_injured', models.IntegerField(blank=True,
                                                        null=True)),
                ('gov_num_dead', models.IntegerField(blank=True, null=True)),
                ('gov_num_missing', models.IntegerField(blank=True,
                                                        null=True)),
                ('gov_num_affected', models.IntegerField(blank=True,
                                                         null=True)),
                ('gov_num_displaced', models.IntegerField(blank=True,
                                                          null=True)),
                ('gov_num_assisted', models.IntegerField(blank=True,
                                                         null=True)),
                ('actions_others', models.TextField(blank=True, null=True)),
                ('visibility',
                 enumfields.fields.EnumIntegerField(
                     default=1, enum=api.models.VisibilityChoices)),
                ('bulletin',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('dref',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('dref_amount', models.IntegerField(blank=True, null=True)),
                ('appeal',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('appeal_amount', models.IntegerField(blank=True, null=True)),
                ('rdrt',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('num_rdrt', models.IntegerField(blank=True, null=True)),
                ('fact',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('num_fact', models.IntegerField(blank=True, null=True)),
                ('ifrc_staff',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('num_ifrc_staff', models.IntegerField(blank=True, null=True)),
                ('eru_base_camp',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_base_camp_units',
                 models.IntegerField(blank=True, null=True)),
                ('eru_basic_health_care',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_basic_health_care_units',
                 models.IntegerField(blank=True, null=True)),
                ('eru_it_telecom',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_it_telecom_units',
                 models.IntegerField(blank=True, null=True)),
                ('eru_logistics',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_logistics_units',
                 models.IntegerField(blank=True, null=True)),
                ('eru_deployment_hospital',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_deployment_hospital_units',
                 models.IntegerField(blank=True, null=True)),
                ('eru_referral_hospital',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_referral_hospital_units',
                 models.IntegerField(blank=True, null=True)),
                ('eru_relief',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_relief_units', models.IntegerField(blank=True,
                                                         null=True)),
                ('eru_water_sanitation_15',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_water_sanitation_15_units',
                 models.IntegerField(blank=True, null=True)),
                ('eru_water_sanitation_40',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_water_sanitation_40_units',
                 models.IntegerField(blank=True, null=True)),
                ('eru_water_sanitation_20',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.RequestChoices)),
                ('eru_water_sanitation_20_units',
                 models.IntegerField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('countries', models.ManyToManyField(to='api.Country')),
                ('dtype',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='api.DisasterType')),
                ('event',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='field_reports',
                     to='api.Event')),
            ],
            options={
                'ordering': ('-created_at', '-updated_at'),
            },
        ),
        migrations.CreateModel(
            name='FieldReportContact',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ctype', models.CharField(blank=True, max_length=100)),
                ('name', models.CharField(max_length=100)),
                ('title', models.CharField(max_length=300)),
                ('email', models.CharField(max_length=300)),
                ('field_report',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.FieldReport')),
            ],
        ),
        migrations.CreateModel(
            name='GDACSEvent',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('eventid', models.CharField(max_length=12)),
                ('title', models.TextField()),
                ('description', models.TextField()),
                ('image', models.URLField(null=True)),
                ('report', models.URLField(null=True)),
                ('publication_date', models.DateTimeField()),
                ('year', models.IntegerField()),
                ('lat', models.FloatField()),
                ('lon', models.FloatField()),
                ('event_type', models.CharField(max_length=16)),
                ('alert_level',
                 enumfields.fields.EnumIntegerField(
                     default=0, enum=api.models.AlertLevel)),
                ('alert_score', models.CharField(max_length=16, null=True)),
                ('severity', models.TextField()),
                ('severity_unit', models.CharField(max_length=16)),
                ('severity_value', models.CharField(max_length=16)),
                ('population_unit', models.CharField(max_length=16)),
                ('population_value', models.CharField(max_length=16)),
                ('vulnerability', models.IntegerField()),
                ('country_text', models.TextField()),
                ('countries', models.ManyToManyField(to='api.Country')),
            ],
        ),
        migrations.CreateModel(
            name='KeyFigure',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('number', models.IntegerField()),
                ('deck', models.CharField(max_length=50)),
                ('source', models.CharField(max_length=256)),
                ('event',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Event')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('user',
                 models.OneToOneField(
                     editable=False,
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     related_name='profile',
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('org', models.CharField(blank=True, max_length=100)),
                ('org_type',
                 models.CharField(blank=True,
                                  choices=[('NTLS', 'National Society'),
                                           ('DLGN', 'Delegation'),
                                           ('SCRT', 'Secretariat'),
                                           ('ICRC', 'ICRC'),
                                           ('OTHR', 'Other')],
                                  max_length=4)),
                ('city', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
                ('department',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('position',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('phone_number',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('country',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='api.Country')),
            ],
            options={
                'verbose_name': 'User profile',
                'verbose_name_plural': 'User profiles',
            },
        ),
        migrations.CreateModel(
            name='Region',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 enumfields.fields.EnumIntegerField(
                     enum=api.models.RegionName)),
            ],
            options={
                'ordering': ('name', ),
            },
        ),
        migrations.CreateModel(
            name='SituationReport',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('name', models.CharField(max_length=100)),
                ('document',
                 models.FileField(blank=True,
                                  null=True,
                                  storage=api.storage.AzureStorage(),
                                  upload_to=api.models.sitrep_document_path)),
                ('document_url', models.URLField(blank=True)),
                ('event',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Event')),
            ],
        ),
        migrations.CreateModel(
            name='Snippet',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('snippet', models.CharField(max_length=300)),
                ('event',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Event')),
            ],
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('spec', models.TextField(blank=True)),
                ('field_report',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.FieldReport')),
            ],
        ),
        migrations.CreateModel(
            name='SourceType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
            ],
        ),
        migrations.AddField(
            model_name='source',
            name='stype',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                to='api.SourceType'),
        ),
        migrations.AddField(
            model_name='fieldreport',
            name='regions',
            field=models.ManyToManyField(blank=True, to='api.Region'),
        ),
        migrations.AddField(
            model_name='fieldreport',
            name='user',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='user',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='event',
            name='regions',
            field=models.ManyToManyField(to='api.Region'),
        ),
        migrations.AddField(
            model_name='country',
            name='region',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='api.Region'),
        ),
        migrations.AddField(
            model_name='appeal',
            name='country',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='api.Country'),
        ),
        migrations.AddField(
            model_name='appeal',
            name='dtype',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='api.DisasterType'),
        ),
        migrations.AddField(
            model_name='appeal',
            name='event',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='appeals',
                to='api.Event'),
        ),
        migrations.AddField(
            model_name='appeal',
            name='region',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='api.Region'),
        ),
        migrations.AddField(
            model_name='actionstaken',
            name='field_report',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.FieldReport'),
        ),
    ]
Пример #26
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('email', models.EmailField(max_length=50, unique=True)),
                ('fund', models.BigIntegerField(default=10000000)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=True)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'db_table': 'users',
            },
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'companies',
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('img',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=api.models.upload_avatar_path)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'profiles',
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.CharField(max_length=200)),
                ('price', models.IntegerField()),
                ('quantity', models.IntegerField()),
                ('buy_or_sell', models.CharField(max_length=4)),
                ('profit_or_loss_price',
                 models.IntegerField(blank=True, null=True)),
                ('created_at', models.DateTimeField()),
                ('company',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='posts',
                                   to='api.Company')),
                ('likeUsers',
                 models.ManyToManyField(blank=True,
                                        to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='posts',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'posts',
            },
        ),
        migrations.CreateModel(
            name='BoughtStockInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('price', models.IntegerField()),
                ('quantity', models.IntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Company')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'bought_stock_info_list',
            },
        ),
    ]
Пример #27
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
    ]

    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(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=30,
                     unique=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             '^[\\w.@+-]+$',
                             'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.'
                         )
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('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')),
                ('api_key',
                 models.CharField(
                     default=api.models.generate_api_key,
                     help_text='The API key associated with this user.',
                     max_length=40,
                     verbose_name='API Key')),
                ('container_limit',
                 models.IntegerField(
                     default=10,
                     help_text=
                     'The total number of containers the user may have',
                     verbose_name='Container Limit')),
                ('floating_ip_limit',
                 models.IntegerField(
                     default=3,
                     help_text=
                     'The total number of floating IPs the user may have',
                     verbose_name='Floating IP Limit')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Action',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 models.CharField(help_text='The unique ID for the action.',
                                  max_length=100,
                                  verbose_name='Unique ID')),
                ('status',
                 models.IntegerField(
                     help_text='The current status of the action.',
                     verbose_name='Status')),
                ('type',
                 models.CharField(
                     help_text=
                     'This is the type of action that the object represents. For example, this could be "transfer" to represent the state of an image transfer action.',
                     max_length=20,
                     verbose_name='Type')),
                ('started_at',
                 models.DateTimeField(
                     help_text=
                     'A time value given in ISO8601 combined date and time format that represents when the action was initiated.',
                     verbose_name='Started At')),
                ('completed_at',
                 models.DateTimeField(
                     help_text=
                     'A time value given in ISO8601 combined date and time format that represents when the action was completed.',
                     verbose_name='Completed At')),
            ],
        ),
        migrations.CreateModel(
            name='BackupWindow',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('start',
                 models.DateTimeField(
                     help_text=
                     'A time value given in ISO8601 combined date and time format that represents when the backup will start.',
                     verbose_name='Start')),
                ('end',
                 models.DateTimeField(
                     help_text=
                     'A time value given in ISO8601 combined date and time format that represents when the backup will end.',
                     verbose_name='End')),
            ],
        ),
        migrations.CreateModel(
            name='Container',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 models.CharField(help_text='The unique ID for the container.',
                                  max_length=100,
                                  verbose_name='Unique ID')),
                ('name',
                 models.CharField(
                     help_text=
                     'The human-readable name set for the Container instance.',
                     max_length=60,
                     verbose_name='Name')),
                ('memory',
                 models.IntegerField(
                     help_text='Memory of the Container in megabytes.',
                     verbose_name='Memory')),
                ('vcpus',
                 models.IntegerField(help_text='The number of virtual CPUs.',
                                     verbose_name='CPUs')),
                ('disk',
                 models.IntegerField(
                     help_text="The size of the Container's disk in gigabytes.",
                     verbose_name='Disk')),
                ('locked',
                 models.BooleanField(
                     help_text=
                     'A boolean value indicating whether the Container has been locked, preventing actions by users.',
                     verbose_name='Locked')),
                ('created_at',
                 models.DateTimeField(
                     help_text=
                     'A time value given in ISO8601 combined date and time format that represents when the Container was created.',
                     verbose_name='Created At')),
                ('status',
                 models.IntegerField(
                     choices=[(0, b'new'), (1, b'active'), (2, b'off'),
                              (3, b'archive')],
                     help_text=
                     'A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".',
                     verbose_name='Status')),
            ],
        ),
        migrations.CreateModel(
            name='Domain',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(
                     help_text=
                     'The name of the domain itself. This should follow the standard domain format of domain.TLD. For instance, example.com is a valid domain name.',
                     max_length=60,
                     verbose_name='Name')),
                ('ttl',
                 models.IntegerField(
                     help_text=
                     'This value is the time to live for the records on this domain, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.',
                     verbose_name='TTL')),
                ('zone_file',
                 models.TextField(
                     help_text=
                     'This attribute contains the complete contents of the zone file for the selected domain. Individual domain record resources should be used to get more granular control over records. However, this attribute can also be used to get information about the SOA record, which is created automatically and is not accessible as an individual record resource.',
                     verbose_name='Zone File')),
                ('owner',
                 models.ForeignKey(help_text='The owner of the domain.',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Owner')),
            ],
        ),
        migrations.CreateModel(
            name='DomainRecord',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 models.CharField(
                     help_text='The unique ID for the domain record.',
                     max_length=100,
                     verbose_name='Unique ID')),
                ('name',
                 models.CharField(
                     help_text='The name to use for the DNS record.',
                     max_length=60,
                     verbose_name='Name')),
                ('type',
                 models.IntegerField(
                     choices=[(0, b'A'), (1, b'AAAA'), (2, b'CNAME'),
                              (3, b'MX'), (4, b'TXT'), (5, b'SRV'),
                              (6, b'NS')],
                     help_text=
                     'The type of the DNS record (ex: A, CNAME, TXT, ...).',
                     verbose_name='Type')),
                ('data',
                 models.CharField(
                     help_text='The value to use for the DNS record.',
                     max_length=60,
                     verbose_name='Value')),
                ('priority',
                 models.IntegerField(
                     help_text='The priority for SRV and MX records.',
                     null=True,
                     verbose_name='Priority')),
                ('port',
                 models.IntegerField(help_text='The port for SRV records.',
                                     null=True,
                                     verbose_name='Port')),
                ('weight',
                 models.IntegerField(help_text='The weight for SRV records.',
                                     null=True,
                                     verbose_name='Weight')),
                ('domain',
                 models.ForeignKey(
                     help_text='The domain, that this record belongs to.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='api.Domain',
                     verbose_name='Domain')),
                ('owner',
                 models.ForeignKey(help_text='The owner of the domain record.',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Owner')),
            ],
        ),
        migrations.CreateModel(
            name='Feature',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('feature',
                 models.CharField(
                     help_text=
                     'A feature (f.e. if a Container can be backed up)',
                     max_length=20,
                     verbose_name='Feature')),
            ],
        ),
        migrations.CreateModel(
            name='FloatingIP',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 models.CharField(
                     help_text='The unique ID for the floating IP.',
                     max_length=100,
                     verbose_name='Unique ID')),
                ('ip',
                 models.CharField(
                     help_text=
                     'The public IP address of the Floating IP. It also serves as its identifier.',
                     max_length=45,
                     verbose_name='IP')),
                ('container',
                 models.ForeignKey(
                     help_text=
                     'The Container that the Floating IP has been assigned to.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='api.Container',
                     verbose_name='Container')),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 models.CharField(help_text='The unique ID for the image.',
                                  max_length=100,
                                  verbose_name='Unique ID')),
                ('name',
                 models.CharField(
                     help_text=
                     'The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.',
                     max_length=60,
                     verbose_name='Name')),
                ('type',
                 models.IntegerField(
                     choices=[(0, b'snapshot'), (1, b'backup')],
                     help_text=
                     'The kind of image, describing the duration of how long the image is stored. This is either "snapshot" or "backup".',
                     verbose_name='Type')),
                ('distribution',
                 models.CharField(
                     help_text=
                     'This attribute describes the base distribution used for this image.',
                     max_length=100,
                     verbose_name='Distribution')),
                ('slug',
                 models.CharField(
                     help_text=
                     'A uniquely identifying string that is associated with each of the provided public images. These can be used to reference a public image as an alternative to the numeric id.',
                     max_length=100,
                     verbose_name='Slug')),
                ('public',
                 models.BooleanField(
                     help_text=
                     'This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.',
                     verbose_name='Public')),
                ('min_disk_size',
                 models.IntegerField(
                     help_text=
                     "The minimum 'disk' required for a size to use this image.",
                     verbose_name='Minimum Disk Size')),
                ('size_gigabytes',
                 models.IntegerField(
                     help_text='The size of the image in gigabytes.',
                     verbose_name='Size')),
                ('created_at',
                 models.DateTimeField(
                     help_text=
                     'A time value given in ISO8601 combined date and time format that represents when the Image was created.',
                     verbose_name='Created At')),
                ('owner',
                 models.ForeignKey(help_text='The owner of this image.',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Owner')),
            ],
        ),
        migrations.CreateModel(
            name='Kernel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(help_text='The name of the kernel.',
                                  max_length=100,
                                  verbose_name='Name')),
                ('version',
                 models.CharField(help_text='The version of the kernel.',
                                  max_length=100,
                                  verbose_name='Version')),
            ],
        ),
        migrations.CreateModel(
            name='Network',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('version',
                 models.IntegerField(
                     choices=[(0, b'v4'), (1, b'v6')],
                     help_text='The version of the network (can be v4 or v6)',
                     verbose_name='Version')),
                ('netmask',
                 models.CharField(help_text='The netmask of the network.',
                                  max_length=45,
                                  verbose_name='Netmaks')),
                ('gateway',
                 models.CharField(help_text='The gateway of the network.',
                                  max_length=45,
                                  verbose_name='Gateway')),
                ('type',
                 models.IntegerField(
                     choices=[(0, b'public'),
                              (1, b'private')],
                     help_text=
                     'The type of the network (can be public or private)',
                     verbose_name='Type')),
            ],
        ),
        migrations.CreateModel(
            name='Region',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(
                     help_text=
                     'The display name of the region. This will be a full name that is used in the control panel and other interfaces.',
                     max_length=20,
                     verbose_name='Name')),
                ('slug',
                 models.CharField(
                     help_text=
                     'A human-readable string that is used as a unique identifier for each region.',
                     max_length=4,
                     verbose_name='Slug')),
                ('available',
                 models.BooleanField(
                     help_text=
                     'This is a boolean value that represents whether new Containers can be created in this region.',
                     verbose_name='Available')),
                ('features',
                 models.ManyToManyField(
                     help_text='The features available in this region.',
                     to='api.Feature',
                     verbose_name='Features')),
            ],
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('key',
                 models.IntegerField(help_text='The key (id) of the resource.',
                                     verbose_name='Key')),
                ('value',
                 models.CharField(
                     help_text=
                     'The value for the resource (f.e. the type of the resource)',
                     max_length=80,
                     verbose_name='Value')),
            ],
        ),
        migrations.CreateModel(
            name='Size',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('slug',
                 models.CharField(
                     help_text=
                     'A human-readable string that is used to uniquely identify each size.',
                     max_length=10,
                     verbose_name='Slug')),
                ('available',
                 models.BooleanField(
                     help_text=
                     'This is a boolean value that represents whether new Containers can be created with this size.',
                     verbose_name='Available')),
                ('transfer',
                 models.DecimalField(
                     decimal_places=1,
                     help_text=
                     'The amount of transfer bandwidth that is available for Containers created in this size. This only counts traffic on the public interface. The value is given in terabytes.',
                     max_digits=6,
                     verbose_name='Bandwith')),
                ('price_monthly',
                 models.DecimalField(
                     decimal_places=1,
                     help_text=
                     'This attribute describes the monthly cost of this Container size if the Container is kept for an entire month.',
                     max_digits=5,
                     verbose_name='Price Monthly')),
                ('price_hourly',
                 models.DecimalField(
                     decimal_places=1,
                     help_text=
                     'This describes the price of the Container size as measured hourly.',
                     max_digits=8,
                     verbose_name='Price Hourly')),
                ('memory',
                 models.IntegerField(
                     help_text=
                     'The amount of RAM allocated to Containers created of this size. The value is represented in megabytes.',
                     verbose_name='Memory')),
                ('vcpus',
                 models.IntegerField(
                     help_text=
                     'The number of virtual CPUs allocated to Containers of this size.',
                     verbose_name='CPUs')),
                ('disk',
                 models.IntegerField(
                     help_text=
                     'The amount of disk space set aside for Containers of this size. The value is represented in gigabytes.',
                     verbose_name='Disk')),
            ],
        ),
        migrations.CreateModel(
            name='SSHKey',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 models.CharField(help_text='The unique ID for the SSH key.',
                                  max_length=100,
                                  verbose_name='Unique ID')),
                ('name',
                 models.CharField(
                     help_text=
                     'This is the human-readable display name for the given SSH key. This is used to easily identify the SSH keys when they are displayed.',
                     max_length=60,
                     verbose_name='Name')),
                ('fingerprint',
                 models.CharField(
                     help_text=
                     'This attribute contains the fingerprint value that is generated from the public key. This is a unique identifier that will differentiate it from other keys using a format that SSH recognizes.',
                     max_length=512,
                     verbose_name='Fingerprint')),
                ('public_key',
                 models.TextField(
                     help_text=
                     "This attribute contains the entire public key string that was uploaded. This is what is embedded into the root user's authorized_keys file if you choose to include this SSH key during Container creation.",
                     verbose_name='Public Key')),
                ('owner',
                 models.ForeignKey(
                     help_text='The user, that this SSH key belongs to.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='Owner')),
            ],
        ),
        migrations.CreateModel(
            name='Storage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 models.CharField(
                     help_text='The unique ID for the storage volume.',
                     max_length=100,
                     verbose_name='Unique ID')),
                ('name',
                 models.CharField(
                     help_text=
                     'A human-readable name for the Storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters.',
                     max_length=64,
                     verbose_name='Name')),
                ('description',
                 models.CharField(
                     help_text=
                     'An optional free-form text field to describe a Storage volume.',
                     max_length=120,
                     verbose_name='Description')),
                ('size_gigabytes',
                 models.IntegerField(
                     help_text=
                     'The size of the Storage volume in GiB (1024^3).',
                     verbose_name='Size')),
                ('created_at',
                 models.DateTimeField(
                     help_text=
                     'A time value given in ISO8601 combined date and time format that represents when the Storage volume was created.',
                     verbose_name='Created At')),
                ('containers',
                 models.ForeignKey(
                     help_text='The Containers the volume is attached to.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='api.Container',
                     verbose_name='Containers')),
                ('region',
                 models.ForeignKey(
                     help_text=
                     'The region that the Storage volume is located in.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='api.Region',
                     verbose_name='Region')),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(
                     help_text=
                     'The name of the tag. The supported characters for names include alphanumeric characters, dashes, and underscores.',
                     max_length=80,
                     verbose_name='Name')),
                ('resources',
                 models.ManyToManyField(
                     help_text='The resource associated with this tag.',
                     to='api.Resource',
                     verbose_name='Resources')),
            ],
        ),
        migrations.AddField(
            model_name='region',
            name='sizes',
            field=models.ManyToManyField(
                help_text='The sizes available in this region.',
                to='api.Size',
                verbose_name='Sizes'),
        ),
        migrations.AddField(
            model_name='image',
            name='regions',
            field=models.ManyToManyField(
                help_text=
                'This attribute is an array of the regions that the image is available in.',
                to='api.Region',
                verbose_name='Regions'),
        ),
        migrations.AddField(
            model_name='floatingip',
            name='region',
            field=models.ForeignKey(
                help_text=
                'The region that the Floating IP is reserved to. When you query a Floating IP, the entire region object will be returned.',
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Region',
                verbose_name='Region'),
        ),
        migrations.AddField(
            model_name='container',
            name='base_image',
            field=models.ForeignKey(
                help_text=
                'The base image used to create the Container instance.',
                on_delete=django.db.models.deletion.CASCADE,
                related_name='base_image',
                to='api.Image',
                verbose_name='Base Image'),
        ),
        migrations.AddField(
            model_name='container',
            name='features',
            field=models.ForeignKey(
                help_text='A collection of features enabled on this Container.',
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Feature',
                verbose_name='Features'),
        ),
        migrations.AddField(
            model_name='container',
            name='images',
            field=models.ManyToManyField(
                help_text=
                'A collection of the backups and shapshots associated with this Container.',
                related_name='images',
                to='api.Image',
                verbose_name='Images'),
        ),
        migrations.AddField(
            model_name='container',
            name='kernel',
            field=models.ForeignKey(
                help_text=
                'The current kernel. This will initially be set to the kernel of the base image when the Container is created.',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Kernel',
                verbose_name='Kernel'),
        ),
        migrations.AddField(
            model_name='container',
            name='networks',
            field=models.ManyToManyField(
                help_text=
                'The details of the network that are configured for the Container instance.',
                to='api.Network',
                verbose_name='Networks'),
        ),
        migrations.AddField(
            model_name='container',
            name='next_backup_window',
            field=models.OneToOneField(
                help_text=
                "The details of the Container's backups feature, if backups are configured for the Container.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='api.BackupWindow',
                verbose_name='Next Backup Window'),
        ),
        migrations.AddField(
            model_name='container',
            name='owner',
            field=models.ForeignKey(
                help_text='The owner of the Container.',
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='Owner'),
        ),
        migrations.AddField(
            model_name='container',
            name='region',
            field=models.ForeignKey(
                help_text=
                'The region that the Container instance is deployed in.',
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Region',
                verbose_name='Region'),
        ),
        migrations.AddField(
            model_name='container',
            name='size',
            field=models.ForeignKey(
                help_text='The current size object describing the Container.',
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Size',
                verbose_name='Size'),
        ),
        migrations.AddField(
            model_name='container',
            name='tags',
            field=models.ManyToManyField(
                help_text=
                'A collection of Tags the Container has been tagged with.',
                to='api.Tag',
                verbose_name='Tags'),
        ),
        migrations.AddField(
            model_name='container',
            name='volumes',
            field=models.ManyToManyField(
                help_text=
                'A collection containing each Storage volume attached to the Container.',
                to='api.Storage',
                verbose_name='Volumes'),
        ),
        migrations.AddField(
            model_name='action',
            name='region',
            field=models.ForeignKey(
                help_text='The region where the action occurred.',
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Region',
                verbose_name='Region'),
        ),
        migrations.AddField(
            model_name='action',
            name='resource',
            field=models.OneToOneField(
                help_text='The resource that the action is associated with.',
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Resource',
                verbose_name='Resource'),
        ),
        migrations.AddField(
            model_name='action',
            name='user',
            field=models.ForeignKey(
                help_text='The user associated with this action.',
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='User'),
        ),
    ]
Пример #28
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('rut', models.CharField(max_length=15, unique=True)),
                ('nombre', models.CharField(max_length=30)),
                ('apellido', models.CharField(max_length=30)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', api.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Camion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('patente_camion', models.CharField(max_length=20,
                                                    unique=True)),
                ('marca_camion', models.CharField(max_length=20)),
                ('modelo_camion', models.CharField(max_length=20)),
                ('capacidad_camion', models.CharField(max_length=20)),
                ('unidad_medida',
                 models.CharField(choices=[('m3', 'm3'), ('ton', 'ton')],
                                  max_length=5)),
                ('nombre_conductor_principal',
                 models.CharField(max_length=50)),
                ('apellido_conductor_principal',
                 models.CharField(max_length=50)),
                ('telefono_conductor_principal',
                 models.CharField(max_length=20)),
                ('descripcion', models.CharField(blank=True, max_length=20)),
                ('numero_ejes', models.CharField(blank=True, max_length=20)),
                ('color_camion', models.CharField(blank=True, max_length=20)),
                ('foto_camion',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to=api.models.get_upload_path_camion)),
                ('available', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name_plural': 'Camiones',
            },
        ),
        migrations.CreateModel(
            name='Destino',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre_destino', models.CharField(max_length=100)),
                ('nombre_propietario', models.CharField(max_length=100)),
                ('rut_propietario', models.CharField(max_length=20)),
                ('comuna', models.CharField(blank=True, max_length=50)),
                ('calle', models.CharField(blank=True, max_length=50)),
                ('numero', models.IntegerField(blank=True, null=True)),
                ('longitud', models.CharField(max_length=20)),
                ('latitud', models.CharField(max_length=20)),
                ('available', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Origen',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre_origen', models.CharField(max_length=100)),
                ('comuna', models.CharField(blank=True, max_length=50)),
                ('calle', models.CharField(blank=True, max_length=50)),
                ('numero', models.IntegerField(blank=True, null=True)),
                ('latitud', models.CharField(max_length=20)),
                ('longitud', models.CharField(max_length=20)),
                ('available', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name_plural': 'Origenes',
            },
        ),
        migrations.CreateModel(
            name='Proyecto',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('centro_de_coste', models.CharField(max_length=20,
                                                     unique=True)),
                ('nombre_proyecto', models.CharField(max_length=100)),
                ('ubicacion', models.CharField(max_length=100)),
                ('cliente', models.CharField(max_length=100)),
                ('rut_cliente', models.CharField(max_length=20)),
                ('mandante', models.CharField(max_length=100)),
                ('rut_mandante', models.CharField(max_length=20)),
                ('mandante_final', models.CharField(max_length=100)),
                ('cantidad_voucher_imprimir',
                 models.IntegerField(blank=True, default=1)),
                ('available', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Despachador',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('telefono', models.CharField(blank=True, max_length=30)),
                ('origen_asignado', models.IntegerField(blank=True,
                                                        null=True)),
                ('proyecto',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Proyecto')),
            ],
            options={
                'verbose_name_plural': 'Despachadores',
            },
            bases=('api.user', models.Model),
            managers=[
                ('objects', api.models.DespManager()),
            ],
        ),
        migrations.CreateModel(
            name='Suborigen',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre_suborigen', models.CharField(max_length=100)),
                ('activo', models.BooleanField(default=True)),
                ('origen',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Origen')),
            ],
            options={
                'verbose_name_plural': 'Sub-Origenes',
            },
        ),
        migrations.CreateModel(
            name='Subcontratista',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rut', models.CharField(max_length=20, unique=True)),
                ('razon_social', models.CharField(max_length=100)),
                ('nombre_subcontratista', models.CharField(max_length=100)),
                ('nombre_contacto', models.CharField(max_length=50)),
                ('apellido_contacto', models.CharField(max_length=50)),
                ('email_contacto',
                 models.CharField(blank=True, default='', max_length=100)),
                ('telefono_contacto', models.CharField(max_length=20)),
                ('available', models.BooleanField(default=True)),
                ('proyecto',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Proyecto')),
            ],
        ),
        migrations.AddField(
            model_name='origen',
            name='proyecto',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Proyecto'),
        ),
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('material', models.CharField(max_length=100)),
                ('available', models.BooleanField(default=True)),
                ('destino',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Destino')),
            ],
            options={
                'verbose_name_plural': 'Materiales',
            },
        ),
        migrations.AddField(
            model_name='destino',
            name='proyecto',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Proyecto'),
        ),
        migrations.CreateModel(
            name='CodigoQR',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('activo', models.BooleanField(default=True)),
                ('camion',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Camion')),
            ],
            options={
                'verbose_name_plural': 'Codigos QR',
            },
        ),
        migrations.AddField(
            model_name='camion',
            name='subcontratista',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Subcontratista'),
        ),
        migrations.CreateModel(
            name='Voucher',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('proyecto', models.CharField(max_length=100)),
                ('nombre_cliente', models.CharField(max_length=100)),
                ('rut_cliente', models.CharField(max_length=20)),
                ('nombre_subcontratista', models.CharField(max_length=100)),
                ('rut_subcontratista', models.CharField(max_length=20)),
                ('nombre_conductor_principal',
                 models.CharField(max_length=50)),
                ('apellido_conductor_principal',
                 models.CharField(max_length=50)),
                ('fecha_servidor', models.DateField(auto_now_add=True)),
                ('hora_servidor', models.TimeField(auto_now_add=True)),
                ('fecha', models.DateField()),
                ('hora', models.TimeField()),
                ('patente', models.CharField(max_length=20)),
                ('foto_patente',
                 models.FileField(
                     upload_to=api.models.get_upload_path_patente)),
                ('volumen', models.CharField(max_length=20)),
                ('tipo_material', models.CharField(max_length=50)),
                ('punto_origen', models.CharField(max_length=100)),
                ('punto_suborigen', models.CharField(blank=True,
                                                     max_length=100)),
                ('punto_destino', models.CharField(max_length=100)),
                ('contador_impresiones', models.IntegerField()),
                ('id_qr', models.CharField(blank=True, max_length=255)),
                ('despachador',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Despachador')),
            ],
        ),
        migrations.CreateModel(
            name='OrigenTemporal',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('id_origen', models.IntegerField()),
                ('timestamp_inicio',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('duracion', models.IntegerField(default=12)),
                ('activo', models.BooleanField(default=True)),
                ('despachador',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Despachador')),
            ],
            options={
                'verbose_name_plural': 'Origenes',
            },
        ),
        migrations.CreateModel(
            name='Administrador',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('email', models.CharField(max_length=100, unique=True)),
                ('cargo', models.CharField(blank=True, max_length=100)),
                ('proyecto',
                 models.ManyToManyField(blank=True,
                                        related_name='proyecto',
                                        to='api.Proyecto')),
            ],
            options={
                'verbose_name_plural': 'Administradores',
            },
            bases=('api.user', models.Model),
            managers=[
                ('objects', api.models.AdminManager()),
            ],
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterModelOptions(
            name='athlete',
            options={
                'verbose_name': 'Sporcu',
                'verbose_name_plural': 'Sporcular'
            },
        ),
        migrations.AlterModelOptions(
            name='category',
            options={
                'verbose_name': 'Kategori',
                'verbose_name_plural': 'Kategoriler'
            },
        ),
        migrations.AlterModelOptions(
            name='controlpoint',
            options={
                'verbose_name': 'Kontrol Noktası',
                'verbose_name_plural': 'Kontrol Noktaları'
            },
        ),
        migrations.AlterModelOptions(
            name='event',
            options={
                'verbose_name': 'Etkinlik',
                'verbose_name_plural': 'Etkinlikler'
            },
        ),
        migrations.AlterModelOptions(
            name='record',
            options={
                'verbose_name': 'Kayıt',
                'verbose_name_plural': 'Kayıtlar'
            },
        ),
        migrations.AlterField(
            model_name='athlete',
            name='card_id',
            field=models.IntegerField(verbose_name='Kart NO'),
        ),
        migrations.AlterField(
            model_name='athlete',
            name='category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.category',
                verbose_name='Kategori'),
        ),
        migrations.AlterField(
            model_name='athlete',
            name='name',
            field=models.CharField(blank=True,
                                   max_length=100,
                                   null=True,
                                   verbose_name='Ad Soyad'),
        ),
        migrations.AlterField(
            model_name='category',
            name='control_points',
            field=models.JSONField(
                default=list,
                validators=[api.models.validate_control_points],
                verbose_name='Kontrol Noktaları'),
        ),
        migrations.AlterField(
            model_name='category',
            name='event',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.event',
                verbose_name='Etkinlik'),
        ),
        migrations.AlterField(
            model_name='category',
            name='name',
            field=models.CharField(max_length=100,
                                   verbose_name='Kategori Adı'),
        ),
        migrations.AlterField(
            model_name='controlpoint',
            name='desc',
            field=models.TextField(blank=True,
                                   null=True,
                                   verbose_name='Açıklama'),
        ),
        migrations.AlterField(
            model_name='controlpoint',
            name='name',
            field=models.CharField(max_length=100,
                                   unique=True,
                                   verbose_name='Adı'),
        ),
        migrations.AlterField(
            model_name='event',
            name='date',
            field=models.DateField(unique=True, verbose_name='Tarih'),
        ),
        migrations.AlterField(
            model_name='event',
            name='name',
            field=models.CharField(max_length=100,
                                   verbose_name='Etkinlik Adı'),
        ),
        migrations.AlterField(
            model_name='record',
            name='athlete',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.athlete',
                verbose_name='Sporcu'),
        ),
        migrations.AlterField(
            model_name='record',
            name='results',
            field=models.JSONField(default=list, verbose_name='Sonuçlar'),
        ),
        migrations.AlterUniqueTogether(
            name='athlete',
            unique_together={('category', 'card_id')},
        ),
        migrations.AlterUniqueTogether(
            name='category',
            unique_together={('event', 'name'), ('event', 'control_points')},
        ),
    ]
Пример #30
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Business',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Business Name')),
                ('county', models.CharField(max_length=200)),
                ('city', models.CharField(max_length=200)),
                ('street', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Product Category')),
                ('business', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Business')),
            ],
            options={
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('product_name', models.CharField(max_length=255, verbose_name='Product Name')),
                ('product_code', models.CharField(max_length=25, unique=True)),
                ('description', models.TextField(default='')),
                ('unit_price', models.DecimalField(decimal_places=2, max_digits=8)),
                ('purchase_date', models.DateField(default=django.utils.timezone.now)),
                ('total_inital_units', models.PositiveIntegerField()),
                ('end_on', models.DateTimeField(blank=True, null=True)),
                ('expires_on', models.DateField()),
                ('available_units', models.PositiveIntegerField()),
                ('sold_unit', models.PositiveIntegerField(default=0)),
                ('damaged_units', models.PositiveIntegerField(default=0)),
                ('business', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Business')),
                ('product_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='category', to='api.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Receipt',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sold_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('receipt_number', models.CharField(max_length=150)),
                ('total_selling_price', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
                ('business', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Business')),
                ('served_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ReceiptItems',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('selling_price_per_unit', models.DecimalField(decimal_places=2, default=0, max_digits=8)),
                ('units', models.DecimalField(decimal_places=2, max_digits=4)),
                ('items_return', models.DecimalField(decimal_places=2, default=0, max_digits=8)),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Product')),
                ('receipt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Receipt')),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone_number', models.CharField(blank=True, max_length=20, null=True)),
                ('avatar', django_resized.forms.ResizedImageField(blank=True, null=True, upload_to=api.models.get_UserProfile_avatar_path)),
                ('national_id', models.CharField(blank=True, max_length=100, null=True)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='business',
            name='owner',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='api.UserProfile'),
        ),
    ]