Ejemplo n.º 1
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='DetailModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=64, verbose_name='title')),
                ('description', models.TextField(verbose_name='description')),
                ('classification', models.CharField(max_length=30, verbose_name='classification')),
                ('image', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('lat', models.FloatField(blank=True, null=True, verbose_name='latitude')),
                ('lon', models.FloatField(blank=True, null=True, verbose_name='longitude')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'detail',
                'verbose_name_plural': 'details',
            },
        ),
    ]
Ejemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0011_services'),
    ]

    operations = [
        migrations.CreateModel(
            name='ServicesInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('cac_number', models.IntegerField()),
                ('office_address', models.CharField(max_length=250)),
                ('work_identity',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('profile_picture',
                 cloudinary.models.CloudinaryField(
                     default='/avatar/customer.png',
                     max_length=255,
                     verbose_name='images')),
                ('latitude', models.FloatField()),
                ('service_type', models.CharField(default='', max_length=250)),
                ('longitude', models.FloatField()),
                ('location',
                 django.contrib.gis.db.models.fields.PointField(geography=True,
                                                                null=True,
                                                                srid=4326)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='services_idp',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.RemoveField(
            model_name='services',
            name='user',
        ),
        migrations.DeleteModel(name='Services', ),
    ]
Ejemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        ('bcglacier', '0006_auto_20190109_1442'),
    ]

    operations = [
        migrations.CreateModel(
            name='Parks',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=200)),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
            ],
            options={
                'db_table': 'parks',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('title',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='Title (optional)')),
                ('image',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
            ],
        ),
        migrations.AddField(
            model_name='photo',
            name='sid',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='bcglacier.Sites'),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Toy',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(default='', max_length=100)),
                ('brand', models.CharField(default='', max_length=50)),
                ('price', models.FloatField(default='')),
                ('country',
                 models.CharField(choices=[('UK', 'UK'), ('US', 'US'),
                                           ('Europe', 'Europe'),
                                           ('China', 'China'),
                                           ('Korea', 'Korea'),
                                           ('Japan', 'Japan'),
                                           ('SE Asia', 'SE Asia')],
                                  default='China',
                                  max_length=50)),
                ('age',
                 models.CharField(choices=[('0-2 years', '0-2 years'),
                                           ('3-4 years', '3-4 years'),
                                           ('5-7 years', '5-7 years'),
                                           ('8-11 years', '8-11 years'),
                                           ('12-14 years', '12-14 years'),
                                           ('14 years+', '14 years+')],
                                  default='5-7 years',
                                  max_length=50)),
                ('category',
                 models.CharField(choices=[
                     ('Baby and Toddler toys', 'Baby and Toddler toys'),
                     ('Action figure and Dolls', 'Action figures and Dolls'),
                     ('Stuff toys', 'Stuff toys'),
                     ('Craft and activities', 'Craft and activities'),
                     ('Learning toys', 'Learning toys'),
                     ('Electronics', 'Electronics')
                 ],
                                  default='Learning toys',
                                  max_length=50)),
                ('desc', models.TextField(default='')),
                ('features', models.TextField(default='')),
                ('cover', cloudinary.models.CloudinaryField(max_length=255)),
            ],
        ),
    ]
Ejemplo n.º 5
0
class Migration(migrations.Migration):

    dependencies = [
        ('app_core', '0013_auto_20180305_1135'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='module',
            options={'ordering': ('-course__id', 'sort_index')},
        ),
        migrations.AlterModelOptions(
            name='page',
            options={'ordering': ('-module__id', 'sort_index')},
        ),
        migrations.AlterField(
            model_name='module',
            name='course',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='modules', to='app_core.Course', verbose_name='Course'),
        ),
        migrations.AlterField(
            model_name='module',
            name='sort_index',
            field=models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1)], verbose_name='Sort index'),
        ),
        migrations.AlterField(
            model_name='page',
            name='image_file_reference',
            field=cloudinary.models.CloudinaryField(blank=True, max_length=256, verbose_name='Reference to image'),
        ),
        migrations.AlterField(
            model_name='page',
            name='sort_index',
            field=models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1)], verbose_name='Sort index'),
        ),
        migrations.AlterField(
            model_name='studentpagenote',
            name='coord',
            field=models.FloatField(blank=True, null=True, verbose_name='Coordinate'),
        ),
    ]
Ejemplo n.º 6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('draft', models.BooleanField(default=False)),
                ('objectivity', models.FloatField()),
                ('title', models.CharField(max_length=200)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('slug', models.SlugField(blank=True, max_length=400, unique=True)),
                ('thumbnail', cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True)),
                ('thumbnail_url', models.URLField(blank=True, default='https://picsum.photos/1900/1080', null=True)),
            ],
        ),
    ]
Ejemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='brands',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
            ],
        ),
        migrations.CreateModel(
            name='cartTransactionMasters',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('DateCreated', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='cartTransactions',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('Quantity', models.FloatField()),
                ('IsOrdered', models.IntegerField()),
                ('MasterId',
                 models.ForeignKey(
                     db_column='MasterId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.carttransactionmasters')),
            ],
        ),
        migrations.CreateModel(
            name='categories',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
                ('Level', models.IntegerField()),
                ('ImageUrl', models.TextField(max_length=2550, null=True)),
                ('MainCategoryId',
                 models.ForeignKey(
                     db_column='MainCategoryId',
                     db_constraint=False,
                     default='null',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.categories')),
            ],
        ),
        migrations.CreateModel(
            name='countries',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
                ('Symbol', models.TextField(max_length=2550)),
            ],
        ),
        migrations.CreateModel(
            name='orders',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('UnitPrice', models.FloatField()),
                ('TotalPrice', models.FloatField()),
                ('isDelivered', models.BooleanField()),
                ('Latitude', models.TextField(max_length=2550, null=True)),
                ('Longitude', models.TextField(max_length=2550, null=True)),
                ('Quantity', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='orderStatus',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('Code', models.IntegerField()),
                ('StatusNameA', models.TextField(max_length=2550, null=True)),
                ('StatusNameL', models.TextField(max_length=2550)),
            ],
        ),
        migrations.CreateModel(
            name='products',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
                ('Image', models.ImageField(blank=True,
                                            null=True,
                                            upload_to='')),
                ('Image2',
                 models.ImageField(blank=True, null=True, upload_to='')),
                ('Image3',
                 models.ImageField(blank=True, null=True, upload_to='')),
                ('Image4',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('Description', models.TextField(max_length=2550, null=True)),
                ('BrandId',
                 models.ForeignKey(
                     db_column='BrandId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.brands')),
                ('CategoryId',
                 models.ForeignKey(
                     db_column='CategoryId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.categories')),
            ],
        ),
        migrations.CreateModel(
            name='shippingAgents',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
                ('Address1', models.TextField(max_length=2550)),
                ('Address2', models.TextField(max_length=2550, null=True)),
                ('Phone', models.TextField(max_length=2550, null=True)),
                ('Email', models.TextField(max_length=2550)),
                ('Password', models.TextField(max_length=2550)),
                ('PostCode', models.TextField(max_length=2550, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='specifications',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
                ('ShowInFilter', models.BooleanField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='specificationValue',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('Name', models.TextField(max_length=2550)),
            ],
        ),
        migrations.CreateModel(
            name='stores',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
                ('Email', models.TextField(max_length=2550)),
                ('Address', models.TextField(max_length=2550, null=True)),
                ('City', models.TextField(max_length=2550)),
                ('Latitude', models.TextField(max_length=2550, null=True)),
                ('Longitude', models.TextField(max_length=2550, null=True)),
                ('CountryId',
                 models.ForeignKey(
                     db_column='CountryId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.countries')),
                ('ShippingAgentId',
                 models.ForeignKey(
                     db_column='ShippingAgentId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.shippingagents')),
            ],
        ),
        migrations.CreateModel(
            name='transactionTypes',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('Code', models.IntegerField()),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
            ],
        ),
        migrations.CreateModel(
            name='users',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
                ('Email', models.TextField(max_length=2550)),
                ('Password', models.TextField(max_length=2550)),
                ('Address1', models.TextField(max_length=2550, null=True)),
                ('Address2', models.TextField(max_length=2550, null=True)),
                ('Phone', models.IntegerField(null=True)),
                ('City', models.TextField(max_length=2550, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='vendors',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('NameA', models.TextField(max_length=2550, null=True)),
                ('NameL', models.TextField(max_length=2550)),
                ('Address1', models.TextField(max_length=2550)),
                ('Address2', models.TextField(max_length=2550, null=True)),
                ('Phone', models.TextField(max_length=2550, null=True)),
                ('Email', models.TextField(max_length=2550)),
                ('Password', models.TextField(max_length=2550)),
                ('PostCode', models.TextField(max_length=2550, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='vendorPriceLists',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('Price', models.FloatField()),
                ('CountryId',
                 models.ForeignKey(
                     db_column='CountryId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.countries')),
                ('ProductId',
                 models.ForeignKey(
                     db_column='ProductId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.products')),
                ('VendorId',
                 models.ForeignKey(
                     db_column='VendorId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.vendors')),
            ],
        ),
        migrations.CreateModel(
            name='storeShippingAgents',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('ShippingAgentId',
                 models.ForeignKey(
                     db_column='ShippingAgentId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.shippingagents')),
                ('StoreId',
                 models.ForeignKey(
                     db_column='StoreId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.stores')),
            ],
        ),
        migrations.AddField(
            model_name='stores',
            name='VendorId',
            field=models.ForeignKey(
                db_column='VendorId',
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.vendors'),
        ),
        migrations.CreateModel(
            name='shippingDetails',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('DeliveryNotes', models.TextField(max_length=2550,
                                                   null=True)),
                ('OrderId',
                 models.ForeignKey(
                     db_column='OrderId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.orders')),
                ('ShippingAgentId',
                 models.ForeignKey(
                     db_column='ShippingAgentId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.shippingagents')),
            ],
        ),
        migrations.CreateModel(
            name='shippingAgentUsers',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('ShippingAgentId',
                 models.ForeignKey(
                     db_column='ShippingAgentId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.shippingagents')),
                ('UserId',
                 models.ForeignKey(
                     db_column='UserId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.users')),
            ],
        ),
        migrations.CreateModel(
            name='productStoreRatings',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('RatingId', models.IntegerField()),
                ('ProductReview', models.TextField(max_length=2550,
                                                   null=True)),
                ('ProductId',
                 models.ForeignKey(
                     db_column='ProductId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.products')),
                ('StoreId',
                 models.ForeignKey(
                     db_column='StoreId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.stores')),
                ('UserId',
                 models.ForeignKey(
                     db_column='UserId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.users')),
            ],
        ),
        migrations.CreateModel(
            name='productSpecifications',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('SpecificationName', models.TextField(max_length=2550)),
                ('SpecificationValue', models.TextField(max_length=2550)),
                ('ShowInFilter', models.BooleanField(null=True)),
                ('CategoryId',
                 models.ForeignKey(
                     db_column='CategoryId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.categories')),
                ('ProductId',
                 models.ForeignKey(
                     db_column='ProductId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.products')),
                ('SpecificationId',
                 models.ForeignKey(
                     db_column='SpecificationId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.specifications')),
            ],
        ),
        migrations.AddField(
            model_name='orders',
            name='DeliveredByUserId',
            field=models.ForeignKey(
                db_column='DeliveredByUserId',
                db_constraint=False,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name='UserId',
                to='PyCommerce.users'),
        ),
        migrations.AddField(
            model_name='orders',
            name='MasterId',
            field=models.ForeignKey(
                db_column='MasterId',
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.carttransactionmasters'),
        ),
        migrations.AddField(
            model_name='orders',
            name='ProductId',
            field=models.ForeignKey(
                db_column='ProductId',
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.products'),
        ),
        migrations.AddField(
            model_name='orders',
            name='ShippingAgentId',
            field=models.ForeignKey(
                db_column='ShippingAgentId',
                db_constraint=False,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.shippingagents'),
        ),
        migrations.AddField(
            model_name='orders',
            name='StoreId',
            field=models.ForeignKey(
                db_column='StoreId',
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.stores'),
        ),
        migrations.AddField(
            model_name='orders',
            name='UserId',
            field=models.ForeignKey(
                db_column='UserId',
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.users'),
        ),
        migrations.AddField(
            model_name='orders',
            name='cartId',
            field=models.ForeignKey(
                db_column='CartId',
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.carttransactions'),
        ),
        migrations.CreateModel(
            name='orderMasters',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('DateCreated', models.DateTimeField()),
                ('ShippingAddress', models.TextField(max_length=2550,
                                                     null=True)),
                ('OrderStatusId',
                 models.ForeignKey(
                     db_column='OrderStatusId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.orderstatus')),
                ('UserId',
                 models.ForeignKey(
                     db_column='UserId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.users')),
                ('cartId',
                 models.ForeignKey(
                     db_column='CartId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.carttransactions')),
            ],
        ),
        migrations.CreateModel(
            name='inventoryDetails',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('Quantity', models.FloatField()),
                ('ProductId',
                 models.ForeignKey(
                     db_column='ProductId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.products')),
                ('StoreId',
                 models.ForeignKey(
                     db_column='StoreId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.stores')),
            ],
        ),
        migrations.CreateModel(
            name='inventoryBalances',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('QuantityBalance', models.FloatField()),
                ('ProductId',
                 models.ForeignKey(
                     db_column='ProductId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.products')),
                ('StoreId',
                 models.ForeignKey(
                     db_column='StoreId',
                     db_constraint=False,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='PyCommerce.stores')),
            ],
        ),
        migrations.AddField(
            model_name='carttransactions',
            name='ProductId',
            field=models.ForeignKey(
                db_column='ProductId',
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.products'),
        ),
        migrations.AddField(
            model_name='carttransactions',
            name='StoreId',
            field=models.ForeignKey(
                db_column='StoreId',
                db_constraint=False,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='PyCommerce.stores'),
        ),
    ]
Ejemplo n.º 8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('profile_pic',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('bio', models.TextField()),
                ('location', models.CharField(max_length=60)),
                ('email', models.EmailField(max_length=254)),
                ('portfolio_link', models.URLField()),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('screenshot',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('description', models.TextField()),
                ('link', models.URLField()),
                ('post_date', models.DateTimeField(auto_now_add=True,
                                                   null=True)),
                ('design_score', models.IntegerField(default=0)),
                ('usability_score', models.IntegerField(default=0)),
                ('content_score', models.IntegerField(default=0)),
                ('average_design', models.FloatField(default=0)),
                ('average_usability', models.FloatField(default=0)),
                ('average_content', models.FloatField(default=0)),
                ('average_score', models.FloatField(default=0)),
                ('profile',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='awardsapp.profile')),
                ('voters',
                 models.ManyToManyField(related_name='votes',
                                        to='awardsapp.Profile')),
            ],
        ),
    ]
Ejemplo n.º 9
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Artist',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('mailing_address',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Mailing_Address')),
                ('instagram', models.URLField(blank=True, null=True)),
                ('facebook', models.URLField(blank=True, null=True)),
                ('twitter', models.URLField(blank=True, null=True)),
                ('image_artist',
                 cloudinary.models.CloudinaryField(
                     default=
                     'https://res.cloudinary.com/dqj36cjxw/image/upload/v1607600679/Rectangle_52_jiszkm.png',
                     max_length=255,
                     verbose_name='Profile')),
                ('user',
                 models.OneToOneField(
                     blank=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='BillingAdress',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('street_adress', models.CharField(max_length=200)),
                ('apartment_adress', models.CharField(max_length=200)),
                ('zip', models.CharField(max_length=200)),
                ('country',
                 django_countries.fields.CountryField(max_length=2)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100, unique=True)),
                ('price', models.FloatField()),
                ('discount_price',
                 models.FloatField(blank=True, default=0, null=True)),
                ('category',
                 models.CharField(choices=[('Pa', 'Painting'),
                                           ('Ph', 'photograph'),
                                           ('sc', 'sculpture'),
                                           ('pr', 'prints')],
                                  max_length=2)),
                ('label',
                 models.CharField(choices=[('P', 'primary'),
                                           ('S', 'secondary'),
                                           ('D', 'danger')],
                                  max_length=2)),
                ('slug', models.SlugField(unique=True, verbose_name='Tag')),
                ('description', models.TextField()),
                ('image',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('artist',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Artist')),
                ('likes',
                 models.ManyToManyField(blank=True,
                                        related_name='likes',
                                        to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Show',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('date', models.DateField()),
                ('time', models.TimeField()),
                ('location', models.CharField(max_length=100)),
                ('RSVP', models.CharField(max_length=100)),
                ('poster',
                 cloudinary.models.CloudinaryField(
                     default=
                     'https://res.cloudinary.com/dqj36cjxw/image/upload/v1609854605/uis0nvmmwdkfkhydtenu.jpg',
                     max_length=255,
                     verbose_name='Poster')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='PaymentDetails',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
                ('cardno',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('expiry_date',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('billing_adress',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('CITY', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
                ('user',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('stripe_charge_id', models.CharField(max_length=100)),
                ('amount', models.FloatField()),
                ('time_stamp', models.DateTimeField()),
                ('billing_adress',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='core.BillingAdress')),
                ('user',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ordered', models.BooleanField(default=False)),
                ('status', models.BooleanField(default=False)),
                ('quantity', models.IntegerField(default=1)),
                ('item',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Item')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('start_date', models.DateTimeField(auto_now_add=True)),
                ('date_ordered', models.DateTimeField()),
                ('ordered', models.BooleanField(default=False)),
                ('billing_adress',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='core.BillingAdress')),
                ('items', models.ManyToManyField(to='core.OrderItem')),
                ('payment',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='core.Payment')),
                ('user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Gallery',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('host_name',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('gallery_email',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('gallery_number',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('gallery_address',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('city_state_zip_code',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('gallery_website',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Chat',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('message', models.TextField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('reciever',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='send_to',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='To')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sender',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('buyer', models.BooleanField(default=False)),
                ('seller', models.BooleanField(default=False)),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('address1',
                 models.CharField(max_length=60,
                                  verbose_name='Address line 1')),
                ('address2',
                 models.CharField(blank=True,
                                  max_length=60,
                                  verbose_name='Address line 2')),
                ('zip_code',
                 models.CharField(max_length=12,
                                  verbose_name='ZIP or Postal code')),
                ('city', models.CharField(max_length=60)),
                ('country',
                 models.CharField(choices=[('uk', 'United Kingdom'),
                                           ('us', 'United States of America'),
                                           ('jp', 'Japan'),
                                           ('id', 'Indonesia')],
                                  max_length=3)),
            ],
            options={
                'verbose_name_plural': 'Addresses',
            },
        ),
        migrations.CreateModel(
            name='Brewery',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(blank=True, max_length=250, unique=True)),
                ('address', models.CharField(blank=True, max_length=200)),
                ('prefecture',
                 models.CharField(blank=True, max_length=20, null=True)),
                ('phone', models.CharField(blank=True, max_length=50)),
                ('email',
                 models.EmailField(blank=True, max_length=254, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('image',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('lat', models.FloatField(blank=True, null=True)),
                ('long', models.FloatField(blank=True, null=True)),
                ('website', models.CharField(blank=True, max_length=100)),
                ('header',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='header')),
            ],
            options={
                'verbose_name_plural': 'Breweries',
            },
        ),
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status',
                 models.IntegerField(choices=[(10, 'Open'), (20, 'Submitted')],
                                     default=10)),
            ],
        ),
        migrations.CreateModel(
            name='CartLine',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantity',
                 models.PositiveIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
            ],
        ),
        migrations.CreateModel(
            name='Cluster',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status',
                 models.IntegerField(choices=[(10, 'New'), (20, 'Paid'),
                                              (30, 'Done')],
                                     default=10)),
                ('billing_name', models.CharField(max_length=60)),
                ('billing_address1', models.CharField(max_length=60)),
                ('billing_address2', models.CharField(blank=True,
                                                      max_length=60)),
                ('billing_zip_code', models.CharField(max_length=12)),
                ('billing_city', models.CharField(max_length=60)),
                ('billing_country', models.CharField(max_length=3)),
                ('shipping_name', models.CharField(max_length=60)),
                ('shipping_address1', models.CharField(max_length=60)),
                ('shipping_address2',
                 models.CharField(blank=True, max_length=60)),
                ('shipping_zip_code', models.CharField(max_length=12)),
                ('shipping_city', models.CharField(max_length=60)),
                ('shipping_country', models.CharField(max_length=3)),
                ('date_updated', models.DateTimeField(auto_now=True)),
                ('date_added', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='OrderLine',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status',
                 models.IntegerField(choices=[(10, 'New'), (20, 'Processing'),
                                              (30, 'Sent'), (40, 'Cancelled')],
                                     default=10)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('lede', models.CharField(blank=True,
                                          max_length=200,
                                          null=True)),
                ('date', models.DateTimeField(blank=True, null=True)),
                ('image',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('body', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.TextField(blank=True, null=True)),
                ('short_description', models.TextField(blank=True, null=True)),
                ('price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=10,
                                     null=True)),
                ('slug', models.SlugField(max_length=100, null=True)),
                ('active',
                 models.BooleanField(blank=True, default=True, null=True)),
                ('in_stock',
                 models.BooleanField(blank=True, default=True, null=True)),
                ('date_updated', models.DateTimeField(auto_now=True,
                                                      null=True)),
                ('abv', models.FloatField(blank=True, default=0, null=True)),
                ('sake_type',
                 models.CharField(choices=[('jd', 'Junmai Daiginjo'),
                                           ('d', 'Daiginjo'),
                                           ('jg', 'Junmai Ginjo'),
                                           ('g', 'Ginjo'), ('j', 'Junmai'),
                                           ('h', 'Honjozo'), ('f', 'Futsu'),
                                           ('o', 'Other')],
                                  max_length=3)),
                ('volume', models.PositiveIntegerField(blank=True, null=True)),
                ('units_sold',
                 models.PositiveIntegerField(blank=True, default=0,
                                             null=True)),
            ],
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
            ],
        ),
        migrations.CreateModel(
            name='ProductTag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('slug', models.SlugField(max_length=48)),
                ('description', models.TextField(blank=True)),
                ('active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Date published')),
                ('rating',
                 models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'),
                                              (4, '4'), (5, '5')],
                                     null=True)),
                ('content',
                 models.TextField(verbose_name='Write your review here...')),
                ('lat', models.FloatField(blank=True, null=True)),
                ('long', models.FloatField(blank=True, null=True)),
                ('postcode',
                 models.CharField(blank=True, max_length=128, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('profile_image',
                 cloudinary.models.CloudinaryField(
                     max_length=255, verbose_name='profile_image')),
            ],
        ),
    ]
Ejemplo n.º 11
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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=120, unique=True)),
                ('authy_id', models.CharField(max_length=250)),
                ('password', models.CharField(max_length=250)),
                ('is_confirmed', models.BooleanField(default=False)),
                ('phone_number_verified', models.BooleanField(default=False)),
                ('contact_number', models.CharField(max_length=250)),
                ('is_property_owner', models.BooleanField(default=False)),
                ('is_agent', models.BooleanField(default=False)),
                ('is_developer', models.BooleanField(default=False)),
                ('is_institute', models.BooleanField(default=False)),
                ('is_government', models.BooleanField(default=False)),
                ('is_customer', models.BooleanField(default=False)),
                ('is_hotelier', models.BooleanField(default=False)),
                ('is_valuer', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_supplier', 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,
            },
            managers=[
                ('objects', accounts.managers.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='AgentInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('cac_number', models.IntegerField()),
                ('office_address', models.CharField(max_length=250)),
                ('work_identity', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
                ('location', django.contrib.gis.db.models.fields.PointField(geography=True, null=True, srid=4326)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='agent', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('contact_address', models.CharField(blank=True, max_length=150)),
                ('notify', models.BooleanField(default=False)),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='customer', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='DeveloperInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('cac_number', models.IntegerField()),
                ('office_address', models.CharField(max_length=250)),
                ('work_identity', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
                ('location', django.contrib.gis.db.models.fields.PointField(geography=True, null=True, srid=4326)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='developer', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GovernmentInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('cac_number', models.IntegerField()),
                ('office_address', models.CharField(max_length=250)),
                ('work_identity', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
                ('location', django.contrib.gis.db.models.fields.PointField(geography=True, null=True, srid=4326)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='government', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HotelInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hotel_name', models.CharField(max_length=25, unique=True)),
                ('cac_number', models.IntegerField(unique=True)),
                ('hotel_website', models.URLField(blank=True, unique=True)),
                ('address', models.CharField(max_length=250)),
                ('city', models.CharField(default='', max_length=250)),
                ('state', models.CharField(default='', max_length=250)),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
                ('location', django.contrib.gis.db.models.fields.PointField(geography=True, null=True, srid=4326)),
                ('work_identity', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='hotelier', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Institute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('institute_name', models.CharField(max_length=250)),
                ('institute_address', models.CharField(max_length=250)),
                ('cac_number', models.CharField(max_length=250)),
                ('work_identity', cloudinary.models.CloudinaryField(max_length=255, verbose_name='images')),
                ('website', models.URLField(blank=True)),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='institute', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='PropertyOwnerInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('contact_address', models.CharField(max_length=250)),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('gender', models.CharField(max_length=250)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='owner', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Supplier',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('cac_number', models.IntegerField()),
                ('office_address', models.CharField(max_length=250)),
                ('work_identity', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
                ('location', django.contrib.gis.db.models.fields.PointField(geography=True, null=True, srid=4326)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='supplier', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='UserPortFolio',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('contact_address', models.CharField(max_length=250)),
                ('email', models.EmailField(max_length=254)),
                ('phone_number', models.CharField(max_length=250)),
                ('professional_summary', models.TextField()),
                ('education', models.TextField()),
                ('work_experince', models.TextField()),
                ('skill_set', models.TextField()),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Valuer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=250)),
                ('cac_number', models.IntegerField()),
                ('office_address', models.CharField(max_length=250)),
                ('work_identity', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('profile_picture', cloudinary.models.CloudinaryField(default='/avatar/customer.png', max_length=255, verbose_name='images')),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
                ('location', django.contrib.gis.db.models.fields.PointField(geography=True, null=True, srid=4326)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='valuer', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
Ejemplo n.º 12
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('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')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('loja', models.BooleanField(default=False)),
                ('nome', models.CharField(max_length=50, unique=True)),
                ('senha', models.CharField(max_length=50, null=True)),
                ('telefone', models.CharField(max_length=20, null=True)),
                ('email', models.CharField(max_length=35, null=True)),
                ('cpf', models.CharField(max_length=16, null=True,
                                         unique=True)),
                ('data', models.DateTimeField(auto_now_add=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_superuser', 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={
                'permissions': [('adicionar_prod', 'Adicionar produto'),
                                ('pagar_prod', 'Pagar produtos'),
                                ('uai', 'te4s')],
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Carrinho',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('valor', models.FloatField(blank=True, default=0.0)),
                ('data', models.DateTimeField(auto_now_add=True)),
                ('cliente_cli',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='Cliente',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Produto',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nome', models.CharField(max_length=50)),
                ('descricao', models.CharField(max_length=100)),
                ('preco', models.FloatField(default=0.0)),
                ('img_prod',
                 cloudinary.models.CloudinaryField(max_length=255)),
                ('tipo',
                 models.CharField(choices=[('R', 'Relogio'),
                                           ('A', 'Acessorio'),
                                           ('v', 'Vesturaio')],
                                  max_length=1)),
                ('data', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Venda',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('quantidade', models.IntegerField(default=1)),
                ('observacao',
                 models.TextField(blank=True,
                                  default='Sem Observações.',
                                  max_length=170)),
                ('status',
                 models.CharField(choices=[('P', 'Pedido realizado'),
                                           ('F', 'Fazendo'),
                                           ('S', 'Saiu para entrega'),
                                           ('E', 'Foi entregue'),
                                           ('C', 'Cancelado')],
                                  default='P',
                                  max_length=1)),
                ('status_pago',
                 models.CharField(choices=[('P', 'Pago'), ('R', 'Resto'),
                                           ('N', 'Não pago')],
                                  default='N',
                                  max_length=1)),
                ('valor', models.FloatField(blank=True, default=0.0)),
                ('data', models.DateTimeField(auto_now_add=True)),
                ('carrinho',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='carrinho_cli',
                                   to='loja.Carrinho')),
                ('produto_cli',
                 models.ManyToManyField(related_name='produto_cli',
                                        to='loja.Produto')),
            ],
        ),
        migrations.CreateModel(
            name='Tot_ped',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantidade', models.IntegerField(default=1)),
                ('carrinho',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='carrinho',
                                   to='loja.Carrinho')),
                ('produto_carrinho',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='prod_carrinho',
                                   to='loja.Produto')),
            ],
        ),
        migrations.CreateModel(
            name='Pagamentos',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('formapg',
                 models.CharField(choices=[('C', 'Cartão'), ('P', 'Pix'),
                                           ('D', 'Dinheiro')],
                                  default='D',
                                  max_length=1)),
                ('status',
                 models.CharField(choices=[('C', 'Completo'),
                                           ('P', 'Processo'),
                                           ('R', 'Recusado')],
                                  default='R',
                                  max_length=1)),
                ('valor', models.FloatField(blank=True, default=0.0)),
                ('data', models.DateTimeField(auto_now_add=True)),
                ('carrinho_ped',
                 models.ManyToManyField(blank=True,
                                        related_name='carribgo_ped',
                                        to='loja.Carrinho')),
            ],
        ),
        migrations.AddField(
            model_name='carrinho',
            name='produto_cli',
            field=models.ManyToManyField(blank=True,
                                         related_name='produto',
                                         to='loja.Produto'),
        ),
    ]
Ejemplo n.º 13
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('device_identifier',
                 models.CharField(max_length=30, unique=True)),
                ('name', models.CharField(max_length=30)),
                ('description', models.TextField()),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SecondaryCircuit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('device_identifier', models.CharField(max_length=30)),
                ('command', models.CharField(max_length=30)),
                ('message', models.TextField()),
                ('received_on', models.DateTimeField(auto_now_add=True)),
                ('device',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='tracker.Device')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=30)),
                ('bio', models.TextField(blank=True)),
                ('location', models.CharField(blank=True, max_length=50)),
                ('profile_pic',
                 cloudinary.models.CloudinaryField(blank=True,
                                                   max_length=255,
                                                   verbose_name='image')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='GPSCoordinate',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('device_identifier', models.CharField(max_length=30)),
                ('command', models.CharField(max_length=30)),
                ('longitude', models.FloatField()),
                ('latitude', models.FloatField()),
                ('received_on', models.DateTimeField(auto_now_add=True)),
                ('device',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='tracker.Device')),
            ],
        ),
    ]
Ejemplo n.º 14
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Announcement',
            fields=[
                ('announcement_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=31)),
                ('body', models.TextField()),
                ('post_date', models.DateField(auto_now_add=True, null=True)),
            ],
            options={
                'db_table': 'at_announcements',
            },
        ),
        migrations.CreateModel(
            name='Assignment',
            fields=[
                ('assignment_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('assignment_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(max_length=31, null=True)),
                ('description', models.TextField(null=True)),
                ('start_date', models.DateField(null=True)),
                ('due_date', models.DateField(null=True)),
                ('worth',
                 models.PositiveSmallIntegerField(
                     choices=[(0, '0 %'), (10, '10 %'), (15, '15 %'),
                              (20, '20 %'), (25, '25 %'), (30, '30 %'),
                              (35, '35 %'), (40, '40 %'), (45, '45 %'),
                              (50, '50 %'), (55, '55 %'), (60, '60 %'),
                              (65, '65 %'), (70, '70 %'), (75, '75 %'),
                              (80, '80 %'), (85, '85 %'), (90, '90 %'),
                              (95, '95 %'), (100, '100 %')],
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
            ],
            options={
                'db_table': 'at_assignments',
            },
        ),
        migrations.CreateModel(
            name='AssignmentSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('percent', models.FloatField(default=0)),
                ('earned_marks', models.FloatField(default=0)),
                ('total_marks', models.PositiveSmallIntegerField(default=0)),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('is_finished', models.BooleanField(default=False)),
                ('assignment',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_assignment_submissions',
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=150)),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('image',
                 cloudinary.models.CloudinaryField(blank=True,
                                                   max_length=255,
                                                   null=True,
                                                   verbose_name='image')),
            ],
            options={
                'verbose_name': 'category',
                'verbose_name_plural': 'categories',
                'ordering': ('name', ),
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=127)),
                ('sub_title', models.CharField(max_length=127)),
                ('description', models.TextField(null=True)),
                ('start_date', models.DateField(null=True)),
                ('finish_date', models.DateField(null=True)),
                ('is_official', models.BooleanField(default=False)),
                ('status', models.PositiveSmallIntegerField(default=0)),
                ('image',
                 cloudinary.models.CloudinaryField(blank=True,
                                                   max_length=255,
                                                   null=True,
                                                   verbose_name='image')),
                ('price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0.0,
                                     max_digits=7)),
                ('discount_price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0.0,
                                     max_digits=7)),
                ('category',
                 models.ForeignKey(default='Leadership',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='courses',
                                   to='registrar.Category')),
                ('students', models.ManyToManyField(to='account.Student')),
                ('teacher',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Teacher')),
            ],
            options={
                'db_table': 'at_courses',
            },
        ),
        migrations.CreateModel(
            name='CourseDiscussionPost',
            fields=[
                ('post_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('title', models.CharField(max_length=127)),
                ('text', models.TextField(blank=True, null=True)),
                ('date', models.DateTimeField(auto_now=True, null=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'at_course_discussion_posts',
            },
        ),
        migrations.CreateModel(
            name='CourseDiscussionThread',
            fields=[
                ('thread_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=127)),
                ('text', models.TextField(blank=True, null=True)),
                ('date', models.DateTimeField(auto_now=True, null=True)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
                ('posts',
                 models.ManyToManyField(to='registrar.CourseDiscussionPost')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'at_course_discussion_threads',
            },
        ),
        migrations.CreateModel(
            name='CourseFinalMark',
            fields=[
                ('credit_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('percent',
                 models.FloatField(
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('is_public', models.BooleanField(default=False)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_course_final_marks',
            },
        ),
        migrations.CreateModel(
            name='CourseSetting',
            fields=[
                ('settings_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('final_exam_percent',
                 models.FloatField(
                     default=50,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('course_percent',
                 models.FloatField(
                     default=50,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_course_settings',
            },
        ),
        migrations.CreateModel(
            name='CourseSubmission',
            fields=[
                ('review_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('status', models.PositiveSmallIntegerField(default=2)),
                ('from_submitter', models.TextField(null=True)),
                ('from_reviewer', models.TextField(null=True)),
                ('review_date', models.DateField(auto_now=True, null=True)),
                ('submission_date', models.DateField(auto_now=True,
                                                     null=True)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_course_submissions',
            },
        ),
        migrations.CreateModel(
            name='EssayQuestion',
            fields=[
                ('question_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('question_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(default='', max_length=31)),
                ('description', models.TextField(default='')),
                ('marks',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('assignment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
            ],
            options={
                'db_table': 'at_essay_questions',
            },
        ),
        migrations.CreateModel(
            name='EssaySubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('file', models.FileField(upload_to='uploads')),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('marks',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.EssayQuestion')),
            ],
            options={
                'db_table': 'at_essay_submissions',
            },
        ),
        migrations.CreateModel(
            name='Exam',
            fields=[
                ('exam_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('exam_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(max_length=31, null=True)),
                ('description', models.TextField(null=True)),
                ('start_date', models.DateField(null=True)),
                ('due_date', models.DateField(null=True)),
                ('worth',
                 models.PositiveSmallIntegerField(
                     choices=[(0, '0 %'), (10, '10 %'), (15, '15 %'),
                              (20, '20 %'), (25, '25 %'), (30, '30 %'),
                              (35, '35 %'), (40, '40 %'), (45, '45 %'),
                              (50, '50 %'), (55, '55 %'), (60, '60 %'),
                              (65, '65 %'), (70, '70 %'), (75, '75 %'),
                              (80, '80 %'), (85, '85 %'), (90, '90 %'),
                              (95, '95 %'), (100, '100 %')],
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('is_final', models.BooleanField(default=False)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='exams',
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_exams',
            },
        ),
        migrations.CreateModel(
            name='ExamSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('percent', models.FloatField(default=0)),
                ('earned_marks', models.FloatField(default=0)),
                ('total_marks', models.PositiveSmallIntegerField(default=0)),
                ('submission_date', models.DateField(auto_now=True,
                                                     null=True)),
                ('is_finished', models.BooleanField(default=False)),
                ('exam',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Exam')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_exam_submissions',
            },
        ),
        migrations.CreateModel(
            name='FileUpload',
            fields=[
                ('upload_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('type', models.PositiveSmallIntegerField(default=0)),
                ('title', models.CharField(max_length=127, null=True)),
                ('description', models.TextField(null=True)),
                ('upload_date', models.DateField(auto_now=True, null=True)),
                ('file',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   null=True,
                                                   verbose_name='fileupload')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'at_file_uploads',
            },
        ),
        migrations.CreateModel(
            name='Lecture',
            fields=[
                ('lecture_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('lecture_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('week_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(default='',
                                           max_length=63,
                                           null=True)),
                ('description', models.TextField(default='', null=True)),
                ('youtube_url', models.URLField(blank=True, null=True)),
                ('vimeo_url', models.URLField(blank=True, null=True)),
                ('bliptv_url', models.URLField(blank=True, null=True)),
                ('preferred_service',
                 models.CharField(choices=[('1', 'YouTube'), ('2', 'Vimeo')],
                                  default='1',
                                  max_length=1)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='lectures',
                                   to='registrar.Course')),
                ('notes', models.ManyToManyField(to='registrar.FileUpload')),
            ],
            options={
                'db_table': 'at_lectures',
            },
        ),
        migrations.CreateModel(
            name='Module',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('module_number',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('module_title', models.CharField(max_length=80)),
                ('module_duration', models.CharField(max_length=191)),
                ('module_description', models.TextField()),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='modules',
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_modules',
            },
        ),
        migrations.CreateModel(
            name='MultipleChoiceQuestion',
            fields=[
                ('question_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('question_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title',
                 models.CharField(blank=True, default='', max_length=31)),
                ('description', models.TextField(default='')),
                ('a', models.CharField(max_length=255, null=True)),
                ('a_is_correct', models.BooleanField(default=False)),
                ('b', models.CharField(max_length=255, null=True)),
                ('b_is_correct', models.BooleanField(default=False)),
                ('c', models.CharField(blank=True, max_length=255, null=True)),
                ('c_is_correct', models.BooleanField(default=False)),
                ('d', models.CharField(blank=True, max_length=255, null=True)),
                ('d_is_correct', models.BooleanField(default=False)),
                ('e', models.CharField(blank=True, max_length=255, null=True)),
                ('e_is_correct', models.BooleanField(default=False)),
                ('f', models.CharField(blank=True, max_length=255, null=True)),
                ('f_is_correct', models.BooleanField(default=False)),
                ('marks',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('assignment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
                ('exam',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Exam')),
            ],
            options={
                'db_table': 'at_multiple_choice_questions',
            },
        ),
        migrations.CreateModel(
            name='MultipleChoiceSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('a', models.BooleanField(default=False)),
                ('b', models.BooleanField(default=False)),
                ('c', models.BooleanField(default=False)),
                ('d', models.BooleanField(default=False)),
                ('e', models.BooleanField(default=False)),
                ('f', models.BooleanField(default=False)),
                ('marks',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.MultipleChoiceQuestion')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_multiple_choice_submissions',
            },
        ),
        migrations.CreateModel(
            name='PeerReview',
            fields=[
                ('review_id',
                 models.AutoField(max_length=11,
                                  primary_key=True,
                                  serialize=False)),
                ('marks',
                 models.PositiveSmallIntegerField(
                     choices=[(0, '0 Star'), (1, '1 Star'), (2, '2 Stars'),
                              (3, '3 Stars'), (4, '4 Stars'), (5, '5 Stars')],
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(5)
                     ])),
                ('text', models.TextField(blank=True, null=True)),
                ('date', models.DateTimeField(auto_now=True, null=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'at_peer_reviews',
            },
        ),
        migrations.CreateModel(
            name='Policy',
            fields=[
                ('policy_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('file',
                 cloudinary.models.CloudinaryField(
                     max_length=255, null=True, verbose_name='policyfiles')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_policys',
            },
        ),
        migrations.CreateModel(
            name='Quick_Overview',
            fields=[
                ('quickoverview_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('description',
                 models.TextField(default='', max_length=60, null=True)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='quickoverview',
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_quickoverview',
            },
        ),
        migrations.CreateModel(
            name='Quiz',
            fields=[
                ('quiz_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('quiz_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('title', models.CharField(max_length=31, null=True)),
                ('description', models.TextField(null=True)),
                ('start_date', models.DateField(null=True)),
                ('due_date', models.DateField(null=True)),
                ('worth',
                 models.PositiveSmallIntegerField(
                     choices=[(0, '0 %'), (10, '10 %'), (15, '15 %'),
                              (20, '20 %'), (25, '25 %'), (30, '30 %'),
                              (35, '35 %'), (40, '40 %'), (45, '45 %'),
                              (50, '50 %'), (55, '55 %'), (60, '60 %'),
                              (65, '65 %'), (70, '70 %'), (75, '75 %'),
                              (80, '80 %'), (85, '85 %'), (90, '90 %'),
                              (95, '95 %'), (100, '100 %')],
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_quizzes',
            },
        ),
        migrations.CreateModel(
            name='QuizSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('percent', models.FloatField(default=0)),
                ('earned_marks', models.FloatField(default=0)),
                ('total_marks', models.PositiveSmallIntegerField(default=0)),
                ('submission_date', models.DateField(auto_now=True,
                                                     null=True)),
                ('is_finished', models.BooleanField(default=False)),
                ('quiz',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Quiz')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_quiz_submissions',
            },
        ),
        migrations.CreateModel(
            name='ResponseQuestion',
            fields=[
                ('question_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('question_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(default='', max_length=31)),
                ('description', models.TextField(default='')),
                ('answer', models.TextField(default='')),
                ('marks',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('assignment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
                ('exam',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Exam')),
                ('quiz',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Quiz')),
            ],
            options={
                'db_table': 'at_response_questions',
            },
        ),
        migrations.CreateModel(
            name='ResponseSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('answer', models.TextField(default='')),
                ('marks',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.ResponseQuestion')),
                ('reviews', models.ManyToManyField(to='registrar.PeerReview')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_response_submissions',
            },
        ),
        migrations.CreateModel(
            name='Syllabus',
            fields=[
                ('syllabus_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('file',
                 cloudinary.models.CloudinaryField(
                     max_length=255, null=True, verbose_name='syllabusfiles')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_syllabus',
            },
        ),
        migrations.CreateModel(
            name='TrueFalseQuestion',
            fields=[
                ('question_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('question_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(default='', max_length=31)),
                ('description', models.TextField(default='')),
                ('true_choice', models.CharField(max_length=127, null=True)),
                ('false_choice', models.CharField(max_length=127, null=True)),
                ('answer', models.BooleanField(default=False)),
                ('marks',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('assignment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
                ('exam',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Exam')),
                ('quiz',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Quiz')),
            ],
            options={
                'db_table': 'at_true_false_questions',
            },
        ),
        migrations.CreateModel(
            name='TrueFalseSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('answer', models.BooleanField(default=False)),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('marks',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.TrueFalseQuestion')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_true_false_submissions',
            },
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('unit_number',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('unit_title', models.CharField(max_length=191)),
                ('unit_description', models.TextField()),
                ('module',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='units',
                                   to='registrar.Module')),
            ],
            options={
                'db_table': 'at_units',
            },
        ),
        migrations.AddField(
            model_name='multiplechoicequestion',
            name='quiz',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Quiz'),
        ),
        migrations.AddField(
            model_name='essaysubmission',
            name='reviews',
            field=models.ManyToManyField(to='registrar.PeerReview'),
        ),
        migrations.AddField(
            model_name='essaysubmission',
            name='student',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='account.Student'),
        ),
        migrations.AddField(
            model_name='essayquestion',
            name='exam',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Exam'),
        ),
        migrations.AddField(
            model_name='essayquestion',
            name='quiz',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Quiz'),
        ),
        migrations.AddField(
            model_name='assignment',
            name='course',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Course'),
        ),
        migrations.AddField(
            model_name='announcement',
            name='course',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Course'),
        ),
    ]
Ejemplo n.º 15
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Food',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('food_name',
                 models.CharField(default='default_food', max_length=50)),
                ('protein', models.FloatField()),
                ('fat', models.FloatField()),
                ('carb', models.FloatField()),
                ('salt', models.FloatField()),
                ('energy', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 cloudinary.models.CloudinaryField(blank=True,
                                                   max_length=255,
                                                   null=True,
                                                   verbose_name='image')),
            ],
        ),
        migrations.CreateModel(
            name='Receipt',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('receipt_date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('image',
                 models.OneToOneField(
                     default=0,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='receiptapp.Image')),
                ('user',
                 models.ForeignKey(default=0,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Fooddetail',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('amount', models.PositiveSmallIntegerField()),
                ('food',
                 models.ForeignKey(default=0,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='receiptapp.Food')),
                ('receipt',
                 models.ForeignKey(default=0,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='receiptapp.Receipt')),
            ],
        ),
    ]
Ejemplo n.º 16
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 cloudinary.models.CloudinaryField(default='image',
                                                   max_length=255,
                                                   verbose_name='image')),
                ('name', models.CharField(max_length=250)),
                ('caption', models.CharField(max_length=250)),
                ('link', models.URLField(max_length=250)),
                ('created', models.DateTimeField(auto_now_add=True,
                                                 null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('design',
                 models.IntegerField(blank=True,
                                     choices=[(1, '1'), (2, '2'), (3, '3'),
                                              (4, '4'), (5, '5'), (6, '6'),
                                              (7, '7'), (8, '8'), (9, '9'),
                                              (10, '10')],
                                     default=0)),
                ('usability',
                 models.IntegerField(blank=True,
                                     choices=[(1, '1'), (2, '2'), (3, '3'),
                                              (4, '4'), (5, '5'), (6, '6'),
                                              (7, '7'), (8, '8'), (9, '9'),
                                              (10, '10')])),
                ('content',
                 models.IntegerField(blank=True,
                                     choices=[(1, '1'), (2, '2'), (3, '3'),
                                              (4, '4'), (5, '5'), (6, '6'),
                                              (7, '7'), (8, '8'), (9, '9'),
                                              (10, '10')])),
                ('score', models.FloatField(blank=True, default=0)),
                ('design_average', models.FloatField(blank=True, default=0)),
                ('usability_average', models.FloatField(blank=True,
                                                        default=0)),
                ('content_average', models.FloatField(blank=True, default=0)),
                ('post',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='ratings',
                                   to='awards.Blog')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='rater',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'get_latest_by': 'score',
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('profile_picture',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('bio',
                 models.TextField(blank=True, default='My Bio',
                                  max_length=500)),
                ('name', models.CharField(blank=True, max_length=120)),
                ('location', models.CharField(blank=True, max_length=60)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='blog',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='blogs',
                to='awards.Profile'),
        ),
    ]
Ejemplo n.º 17
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=120,
                                  verbose_name='Имя продукта')),
                ('title_rus',
                 models.CharField(max_length=120,
                                  verbose_name='Имя продукта НА РУССКОМ')),
                ('subtitle',
                 models.CharField(
                     help_text=
                     'Пример - "Напій ультрапастеризований гречаний 2,5% жиру"',
                     max_length=255,
                     verbose_name='Текст под названием продукта')),
                ('subtitle_rus',
                 models.CharField(
                     help_text=
                     'Пример - "Напій ультрапастеризований гречаний 2,5% жиру"',
                     max_length=255,
                     verbose_name='Текст под названием продукта НА РУССКОМ')),
                ('title_subtitle_color',
                 models.CharField(
                     max_length=7,
                     verbose_name='Код цвета заголовка и подзаголовка (web HEX)'
                 )),
                ('image',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='Картинка')),
                ('cereal_image',
                 cloudinary.models.CloudinaryField(
                     max_length=255, verbose_name='Картинка зерна')),
                ('image_for_product_page',
                 cloudinary.models.CloudinaryField(
                     max_length=255,
                     verbose_name='Картинка для раздела Продукция')),
                ('inner_gradient_color',
                 models.CharField(
                     max_length=7,
                     verbose_name='Код внутреннего цвета градиента (web HEX)')
                 ),
                ('outer_gradient_color',
                 models.CharField(
                     max_length=7,
                     verbose_name='Код внешнего цвета градиента (web HEX)')),
                ('content',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(),
                     help_text=
                     'Каждый новый абзац с новой строки. Без пустых строк!',
                     size=None,
                     verbose_name='Основной текст')),
                ('content_rus',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(),
                     help_text=
                     'Каждый новый абзац с новой строки. Без пустых строк!',
                     size=None,
                     verbose_name='Основной текст НА РУССКОМ')),
                ('list_heading',
                 models.CharField(max_length=255,
                                  verbose_name='Заголовок перед списком')),
                ('list_heading_rus',
                 models.CharField(
                     max_length=255,
                     verbose_name='Заголовок перед списком НА РУССКОМ')),
                ('about_list',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(
                         max_length=255, verbose_name='Элемент списка'),
                     help_text=
                     'Каждый новый элемент с новой строки. Без пустых строк!',
                     size=None,
                     verbose_name='Список особенностецй продукта')),
                ('about_list_rus',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(
                         max_length=255, verbose_name='Элемент списка'),
                     help_text=
                     'Каждый новый элемент с новой строки. Без пустых строк!',
                     size=None,
                     verbose_name='Список особенностецй продукта НА РУССКОМ')),
                ('silly_comment',
                 models.CharField(
                     max_length=255,
                     verbose_name='Смешной заголовок под списком')),
                ('silly_comment_rus',
                 models.CharField(
                     max_length=255,
                     verbose_name='Смешной заголовок под списком НА РУССКОМ')),
                ('calories',
                 models.FloatField(validators=[
                     django.core.validators.MinValueValidator(0.1)
                 ],
                                   verbose_name='Калории в ккал')),
                ('proteins',
                 models.FloatField(validators=[
                     django.core.validators.MinValueValidator(0.1)
                 ],
                                   verbose_name='Белки, г')),
                ('carbohydrates',
                 models.FloatField(validators=[
                     django.core.validators.MinValueValidator(0.1)
                 ],
                                   verbose_name='Углеводы, г')),
                ('cholesterol',
                 models.FloatField(validators=[
                     django.core.validators.MinValueValidator(0.0)
                 ],
                                   verbose_name='Холестерин')),
            ],
            options={
                'verbose_name': 'Продукт',
                'verbose_name_plural': 'Продукты',
                'db_table': 'products',
            },
        ),
    ]
Ejemplo n.º 18
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='HistoricalProduct',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('image',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   null=True,
                                                   verbose_name='image')),
                ('price', models.FloatField(default=0)),
                ('sold_out', models.BooleanField(default=False)),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
                ('product_type',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='type.Type')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'verbose_name': 'historical product',
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AddField(
            model_name='product',
            name='price',
            field=models.FloatField(default=0),
        ),
        migrations.AlterField(
            model_name='product',
            name='image',
            field=cloudinary.models.CloudinaryField(max_length=255,
                                                    null=True,
                                                    verbose_name='image'),
        ),
    ]
Ejemplo n.º 19
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('street_address', models.CharField(max_length=100)),
                ('apartment_address', models.CharField(max_length=100)),
                ('country',
                 django_countries.fields.CountryField(max_length=2)),
                ('zip', models.CharField(max_length=100)),
                ('address_type',
                 models.CharField(choices=[('B', 'Billing'),
                                           ('S', 'Shipping')],
                                  max_length=1)),
                ('default', models.BooleanField(default=False)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Addresses',
            },
        ),
        migrations.CreateModel(
            name='Coupon',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code', models.CharField(max_length=15)),
                ('amount', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('price', models.FloatField()),
                ('discount_price', models.FloatField(blank=True, null=True)),
                ('category',
                 models.CharField(choices=[('S', 'T-Shirt'), ('SW', 'Hoodies'),
                                           ('O', 'Polo Shirt')],
                                  max_length=2)),
                ('label',
                 models.CharField(choices=[('P', 'primary'),
                                           ('S', 'secondary'),
                                           ('D', 'danger')],
                                  max_length=1)),
                ('slug', models.SlugField()),
                ('description', models.TextField()),
                ('size',
                 multiselectfield.db.fields.MultiSelectField(choices=[
                     ('XS', 'XS(36)'), ('S', 'S(38)'), ('M', 'M(40)'),
                     ('L', 'L(42)'), ('XL', 'XL(44)'), ('XXL', 'XXL(46)'),
                     ('XXXL', 'XXXL(48)')
                 ],
                                                             max_length=20)),
                ('image',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ref_code',
                 models.CharField(blank=True, max_length=20, null=True)),
                ('start_date', models.DateTimeField(auto_now_add=True)),
                ('order_date', models.DateTimeField()),
                ('ordered', models.BooleanField(default=False)),
                ('being_delivered', models.BooleanField(default=False)),
                ('received', models.BooleanField(default=False)),
                ('refund_requested', models.BooleanField(default=False)),
                ('refund_granted', models.BooleanField(default=False)),
                ('order_discount_amount', models.FloatField()),
                ('order_total', models.FloatField()),
                ('billing_address',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='billing_address',
                     to='core.Address')),
                ('coupon',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='core.Coupon')),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('stripe_customer_id',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('one_click_purchasing', models.BooleanField(default=False)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Refund',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('reason', models.TextField()),
                ('accepted', models.BooleanField(default=False)),
                ('email', models.EmailField(max_length=254)),
                ('order',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Order')),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('stripe_charge_id', models.CharField(max_length=50)),
                ('amount', models.FloatField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('user',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ordered', models.BooleanField(default=False)),
                ('quantity', models.IntegerField(default=1)),
                ('ordered_size', models.CharField(max_length=4)),
                ('ordereditem_title', models.CharField(max_length=100)),
                ('ordereditem_price', models.FloatField()),
                ('ordereditem_totalprice', models.FloatField()),
                ('item',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Item')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='items',
            field=models.ManyToManyField(to='core.OrderItem'),
        ),
        migrations.AddField(
            model_name='order',
            name='payment',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='core.Payment'),
        ),
        migrations.AddField(
            model_name='order',
            name='shipping_address',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='shipping_address',
                to='core.Address'),
        ),
        migrations.AddField(
            model_name='order',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
    ]
Ejemplo n.º 20
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Announcement',
            fields=[
                ('announcement_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=31)),
                ('body', models.TextField()),
                ('post_date', models.DateField(auto_now_add=True, null=True)),
            ],
            options={
                'db_table': 'at_announcements',
            },
        ),
        migrations.CreateModel(
            name='Assignment',
            fields=[
                ('assignment_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('assignment_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(max_length=31, null=True)),
                ('description', models.TextField(null=True)),
                ('start_date', models.DateField(null=True)),
                ('due_date', models.DateField(null=True)),
                ('worth',
                 models.PositiveSmallIntegerField(
                     choices=[(0, '0 %'), (10, '10 %'), (15, '15 %'),
                              (20, '20 %'), (25, '25 %'), (30, '30 %'),
                              (35, '35 %'), (40, '40 %'), (45, '45 %'),
                              (50, '50 %'), (55, '55 %'), (60, '60 %'),
                              (65, '65 %'), (70, '70 %'), (75, '75 %'),
                              (80, '80 %'), (85, '85 %'), (90, '90 %'),
                              (95, '95 %'), (100, '100 %')],
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
            ],
            options={
                'db_table': 'at_assignments',
            },
        ),
        migrations.CreateModel(
            name='AssignmentSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('percent', models.FloatField(default=0)),
                ('earned_marks', models.FloatField(default=0)),
                ('total_marks', models.PositiveSmallIntegerField(default=0)),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('is_finished', models.BooleanField(default=False)),
                ('assignment',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_assignment_submissions',
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=127)),
                ('sub_title', models.CharField(max_length=127)),
                ('category',
                 models.CharField(choices=[
                     ('Aeronautics & Astronautics',
                      'Aeronautics & Astronautics'),
                     ('Anesthesia', 'Anesthesia'),
                     ('Anthropology', 'Anthropology'),
                     ('Applied Physics', 'Applied Physics'),
                     ('Art or Art History', 'Art & Art History'),
                     ('Astrophysics', 'Astrophysics'),
                     ('Biochemistry', 'Biochemistry'),
                     ('Bioengineering', 'Bioengineering'),
                     ('Biology', 'Biology'), ('Business', 'Business'),
                     ('Cardiothoracic Surgery', 'Cardiothoracic Surgery'),
                     ('Chemical and Systems Biology',
                      'Chemical and Systems Biology'),
                     ('Chemical Engineering', 'Chemical Engineering'),
                     ('Chemistry', 'Chemistry'),
                     ('Civil and Environmental Engineering',
                      'Civil and Environmental Engineering'),
                     ('Classics', 'Classics'),
                     ('Communication', 'Communication'),
                     ('Comparative Literature', 'Comparative Literature'),
                     ('Comparative Medicine', 'Comparative Medicine'),
                     ('Computer Science', 'Computer Science'),
                     ('Dermatology', 'Dermatology'),
                     ('Developmental Biology', 'Developmental Biology'),
                     ('East Asian Languages and Cultures',
                      'East Asian Languages and Cultures'),
                     ('Economics', 'Economics'), ('Education', 'Education'),
                     ('Electrical Engineering', 'Electrical Engineering'),
                     ('English', 'English'), ('French', 'French'),
                     ('Genetics', 'Genetics'),
                     ('General Eduction', 'General Education'),
                     ('Geological and Environmental Sciences',
                      'Geological and Environmental Sciences'),
                     ('Geophysics', 'Geophysics'), ('Health', 'Health'),
                     ('History', 'History'),
                     ('Latin American Cultures', 'Latin American Cultures'),
                     ('Law School', 'Law School'),
                     ('Linguistics', 'Linguistics'),
                     ('Management', 'Management'),
                     ('Materials Science', 'Materials Science'),
                     ('Mathematics', 'Mathematics'),
                     ('Mechanical Engineering', 'Mechanical Engineering'),
                     ('Medicine', 'Medicine'),
                     ('Microbiology and Immunology',
                      'Microbiology and Immunology'),
                     ('Molecular and Cellular Physiology',
                      'Molecular and Cellular Physiology'), ('Music', 'Music'),
                     ('Neurobiology', 'Neurobiology'),
                     ('Neurology', 'Neurology'),
                     ('Neurosurgery', 'Neurosurgery'),
                     ('Obstetrics and Gynecology',
                      'Obstetrics and Gynecology'),
                     ('Ophthalmology', 'Ophthalmology'),
                     ('Orthopaedic Surgery', 'Orthopaedic Surgery'),
                     ('Other', 'Other'), ('Otolaryngology', 'Otolaryngology'),
                     ('Pathology', 'Pathology'), ('Pediatrics', 'Pediatrics'),
                     ('Philosophy', 'Philosophy'), ('Physics', 'Physics'),
                     ('Political Science', 'Political Science'),
                     ('Psychiatry', 'Psychiatry'),
                     ('Psychology', 'Psychology'),
                     ('Radiation Oncology', 'Radiation Oncology'),
                     ('Radiology', 'Radiology'),
                     ('Religious Studies', 'Religious Studies'),
                     ('Slavic Languages and Literature',
                      'Slavic Languages and Literature'),
                     ('Sociology', 'Sociology'), ('Statistics', 'Statistics'),
                     ('Surgery', 'Surgery'),
                     ('Theater and Performance Studies',
                      'Theater and Performance Studies'),
                     ('Urology', 'Urology')
                 ],
                                  default='General Education',
                                  max_length=127)),
                ('description', models.TextField(null=True)),
                ('start_date', models.DateField(null=True)),
                ('finish_date', models.DateField(null=True)),
                ('is_official', models.BooleanField(default=False)),
                ('status', models.PositiveSmallIntegerField(default=0)),
                ('image',
                 cloudinary.models.CloudinaryField(blank=True,
                                                   max_length=255,
                                                   null=True,
                                                   verbose_name='image')),
                ('students', models.ManyToManyField(to='account.Student')),
                ('teacher',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Teacher')),
            ],
            options={
                'db_table': 'at_courses',
            },
        ),
        migrations.CreateModel(
            name='CourseDiscussionPost',
            fields=[
                ('post_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('title', models.CharField(max_length=127)),
                ('text', models.TextField(blank=True, null=True)),
                ('date', models.DateTimeField(auto_now=True, null=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'at_course_discussion_posts',
            },
        ),
        migrations.CreateModel(
            name='CourseDiscussionThread',
            fields=[
                ('thread_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=127)),
                ('text', models.TextField(blank=True, null=True)),
                ('date', models.DateTimeField(auto_now=True, null=True)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
                ('posts',
                 models.ManyToManyField(to='registrar.CourseDiscussionPost')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'at_course_discussion_threads',
            },
        ),
        migrations.CreateModel(
            name='CourseFinalMark',
            fields=[
                ('credit_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('percent',
                 models.FloatField(
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('is_public', models.BooleanField(default=False)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_course_final_marks',
            },
        ),
        migrations.CreateModel(
            name='CourseSetting',
            fields=[
                ('settings_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('final_exam_percent',
                 models.FloatField(
                     default=50,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('course_percent',
                 models.FloatField(
                     default=50,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_course_settings',
            },
        ),
        migrations.CreateModel(
            name='CourseSubmission',
            fields=[
                ('review_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('status', models.PositiveSmallIntegerField(default=2)),
                ('from_submitter', models.TextField(null=True)),
                ('from_reviewer', models.TextField(null=True)),
                ('review_date', models.DateField(auto_now=True, null=True)),
                ('submission_date', models.DateField(auto_now=True,
                                                     null=True)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_course_submissions',
            },
        ),
        migrations.CreateModel(
            name='EssayQuestion',
            fields=[
                ('question_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('question_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(default='', max_length=31)),
                ('description', models.TextField(default='')),
                ('marks',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('assignment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
            ],
            options={
                'db_table': 'at_essay_questions',
            },
        ),
        migrations.CreateModel(
            name='EssaySubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('file', models.FileField(upload_to='uploads')),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('marks',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.EssayQuestion')),
            ],
            options={
                'db_table': 'at_essay_submissions',
            },
        ),
        migrations.CreateModel(
            name='Exam',
            fields=[
                ('exam_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('exam_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(max_length=31, null=True)),
                ('description', models.TextField(null=True)),
                ('start_date', models.DateField(null=True)),
                ('due_date', models.DateField(null=True)),
                ('worth',
                 models.PositiveSmallIntegerField(
                     choices=[(0, '0 %'), (10, '10 %'), (15, '15 %'),
                              (20, '20 %'), (25, '25 %'), (30, '30 %'),
                              (35, '35 %'), (40, '40 %'), (45, '45 %'),
                              (50, '50 %'), (55, '55 %'), (60, '60 %'),
                              (65, '65 %'), (70, '70 %'), (75, '75 %'),
                              (80, '80 %'), (85, '85 %'), (90, '90 %'),
                              (95, '95 %'), (100, '100 %')],
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('is_final', models.BooleanField(default=False)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_exams',
            },
        ),
        migrations.CreateModel(
            name='ExamSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('percent', models.FloatField(default=0)),
                ('earned_marks', models.FloatField(default=0)),
                ('total_marks', models.PositiveSmallIntegerField(default=0)),
                ('submission_date', models.DateField(auto_now=True,
                                                     null=True)),
                ('is_finished', models.BooleanField(default=False)),
                ('exam',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Exam')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_exam_submissions',
            },
        ),
        migrations.CreateModel(
            name='FileUpload',
            fields=[
                ('upload_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('type', models.PositiveSmallIntegerField(default=0)),
                ('title', models.CharField(max_length=127, null=True)),
                ('description', models.TextField(null=True)),
                ('upload_date', models.DateField(auto_now=True, null=True)),
                ('file',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   null=True,
                                                   verbose_name='fileupload')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'at_file_uploads',
            },
        ),
        migrations.CreateModel(
            name='Lecture',
            fields=[
                ('lecture_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('lecture_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('week_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(default='',
                                           max_length=63,
                                           null=True)),
                ('description', models.TextField(default='', null=True)),
                ('youtube_url', models.URLField(blank=True, null=True)),
                ('vimeo_url', models.URLField(blank=True, null=True)),
                ('bliptv_url', models.URLField(blank=True, null=True)),
                ('preferred_service',
                 models.CharField(choices=[('1', 'YouTube'), ('2', 'Vimeo')],
                                  default='1',
                                  max_length=1)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
                ('notes', models.ManyToManyField(to='registrar.FileUpload')),
            ],
            options={
                'db_table': 'at_lectures',
            },
        ),
        migrations.CreateModel(
            name='MultipleChoiceQuestion',
            fields=[
                ('question_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('question_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title',
                 models.CharField(blank=True, default='', max_length=31)),
                ('description', models.TextField(default='')),
                ('a', models.CharField(max_length=255, null=True)),
                ('a_is_correct', models.BooleanField(default=False)),
                ('b', models.CharField(max_length=255, null=True)),
                ('b_is_correct', models.BooleanField(default=False)),
                ('c', models.CharField(blank=True, max_length=255, null=True)),
                ('c_is_correct', models.BooleanField(default=False)),
                ('d', models.CharField(blank=True, max_length=255, null=True)),
                ('d_is_correct', models.BooleanField(default=False)),
                ('e', models.CharField(blank=True, max_length=255, null=True)),
                ('e_is_correct', models.BooleanField(default=False)),
                ('f', models.CharField(blank=True, max_length=255, null=True)),
                ('f_is_correct', models.BooleanField(default=False)),
                ('marks',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('assignment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
                ('exam',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Exam')),
            ],
            options={
                'db_table': 'at_multiple_choice_questions',
            },
        ),
        migrations.CreateModel(
            name='MultipleChoiceSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('a', models.BooleanField(default=False)),
                ('b', models.BooleanField(default=False)),
                ('c', models.BooleanField(default=False)),
                ('d', models.BooleanField(default=False)),
                ('e', models.BooleanField(default=False)),
                ('f', models.BooleanField(default=False)),
                ('marks',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.MultipleChoiceQuestion')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_multiple_choice_submissions',
            },
        ),
        migrations.CreateModel(
            name='PeerReview',
            fields=[
                ('review_id',
                 models.AutoField(max_length=11,
                                  primary_key=True,
                                  serialize=False)),
                ('marks',
                 models.PositiveSmallIntegerField(
                     choices=[(0, '0 Star'), (1, '1 Star'), (2, '2 Stars'),
                              (3, '3 Stars'), (4, '4 Stars'), (5, '5 Stars')],
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(5)
                     ])),
                ('text', models.TextField(blank=True, null=True)),
                ('date', models.DateTimeField(auto_now=True, null=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'at_peer_reviews',
            },
        ),
        migrations.CreateModel(
            name='Policy',
            fields=[
                ('policy_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('file',
                 cloudinary.models.CloudinaryField(
                     max_length=255, null=True, verbose_name='policyfiles')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_policys',
            },
        ),
        migrations.CreateModel(
            name='Quiz',
            fields=[
                ('quiz_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('quiz_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('title', models.CharField(max_length=31, null=True)),
                ('description', models.TextField(null=True)),
                ('start_date', models.DateField(null=True)),
                ('due_date', models.DateField(null=True)),
                ('worth',
                 models.PositiveSmallIntegerField(
                     choices=[(0, '0 %'), (10, '10 %'), (15, '15 %'),
                              (20, '20 %'), (25, '25 %'), (30, '30 %'),
                              (35, '35 %'), (40, '40 %'), (45, '45 %'),
                              (50, '50 %'), (55, '55 %'), (60, '60 %'),
                              (65, '65 %'), (70, '70 %'), (75, '75 %'),
                              (80, '80 %'), (85, '85 %'), (90, '90 %'),
                              (95, '95 %'), (100, '100 %')],
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_quizzes',
            },
        ),
        migrations.CreateModel(
            name='QuizSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('percent', models.FloatField(default=0)),
                ('earned_marks', models.FloatField(default=0)),
                ('total_marks', models.PositiveSmallIntegerField(default=0)),
                ('submission_date', models.DateField(auto_now=True,
                                                     null=True)),
                ('is_finished', models.BooleanField(default=False)),
                ('quiz',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Quiz')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_quiz_submissions',
            },
        ),
        migrations.CreateModel(
            name='ResponseQuestion',
            fields=[
                ('question_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('question_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(default='', max_length=31)),
                ('description', models.TextField(default='')),
                ('answer', models.TextField(default='')),
                ('marks',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('assignment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
                ('exam',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Exam')),
                ('quiz',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Quiz')),
            ],
            options={
                'db_table': 'at_response_questions',
            },
        ),
        migrations.CreateModel(
            name='ResponseSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('answer', models.TextField(default='')),
                ('marks',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.ResponseQuestion')),
                ('reviews', models.ManyToManyField(to='registrar.PeerReview')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_response_submissions',
            },
        ),
        migrations.CreateModel(
            name='Syllabus',
            fields=[
                ('syllabus_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('file',
                 cloudinary.models.CloudinaryField(
                     max_length=255, null=True, verbose_name='syllabusfiles')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Course')),
            ],
            options={
                'db_table': 'at_syllabus',
            },
        ),
        migrations.CreateModel(
            name='TrueFalseQuestion',
            fields=[
                ('question_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('question_num',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('title', models.CharField(default='', max_length=31)),
                ('description', models.TextField(default='')),
                ('true_choice', models.CharField(max_length=127, null=True)),
                ('false_choice', models.CharField(max_length=127, null=True)),
                ('answer', models.BooleanField(default=False)),
                ('marks',
                 models.PositiveSmallIntegerField(
                     default=1,
                     validators=[django.core.validators.MinValueValidator(1)
                                 ])),
                ('assignment',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Assignment')),
                ('exam',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Exam')),
                ('quiz',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.Quiz')),
            ],
            options={
                'db_table': 'at_true_false_questions',
            },
        ),
        migrations.CreateModel(
            name='TrueFalseSubmission',
            fields=[
                ('submission_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('answer', models.BooleanField(default=False)),
                ('submission_date',
                 models.DateTimeField(auto_now=True, null=True)),
                ('marks',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='registrar.TrueFalseQuestion')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='account.Student')),
            ],
            options={
                'db_table': 'at_true_false_submissions',
            },
        ),
        migrations.AddField(
            model_name='multiplechoicequestion',
            name='quiz',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Quiz'),
        ),
        migrations.AddField(
            model_name='essaysubmission',
            name='reviews',
            field=models.ManyToManyField(to='registrar.PeerReview'),
        ),
        migrations.AddField(
            model_name='essaysubmission',
            name='student',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='account.Student'),
        ),
        migrations.AddField(
            model_name='essayquestion',
            name='exam',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Exam'),
        ),
        migrations.AddField(
            model_name='essayquestion',
            name='quiz',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Quiz'),
        ),
        migrations.AddField(
            model_name='assignment',
            name='course',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Course'),
        ),
        migrations.AddField(
            model_name='announcement',
            name='course',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='registrar.Course'),
        ),
    ]
Ejemplo n.º 21
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('projectname', models.CharField(max_length=155)),
                ('website', models.CharField(max_length=100)),
                ('description', models.CharField(max_length=255)),
                ('picture',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('posted', models.DateTimeField(auto_now_add=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='posts',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Rate',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('design', models.IntegerField(default=0, null=True)),
                ('usability', models.IntegerField(default=0, null=True)),
                ('content', models.IntegerField(default=0, null=True)),
                ('creativity', models.IntegerField(default=0, null=True)),
                ('total',
                 models.FloatField(blank=True,
                                   default=0,
                                   max_length=8,
                                   null=True)),
                ('post',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='rate',
                                   to='project.post')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bio',
                 models.TextField(blank=True,
                                  default='No Bio..',
                                  max_length=300)),
                ('name', models.CharField(blank=True, max_length=60)),
                ('country', models.CharField(blank=True, max_length=60)),
                ('prof_pic',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 22
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='AddressSaved',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('street', models.CharField(max_length=100)),
                ('number', models.CharField(max_length=100)),
                ('district', models.CharField(max_length=100)),
                ('floor',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  null=True)),
                ('reference',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  null=True)),
                ('location',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('phone',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('photo', models.CharField(max_length=4000)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        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)),
                ('description', models.CharField(max_length=150)),
                ('phone', models.CharField(max_length=50)),
                ('address', models.CharField(max_length=50)),
                ('available_now',
                 models.CharField(choices=[('SI', 'Si'), ('NO', 'No')],
                                  default='Si',
                                  max_length=2)),
                ('photo',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('limits', models.CharField(max_length=1000)),
                ('account_debit', models.FloatField()),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='CompanyCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(max_length=150)),
                ('photo', models.CharField(max_length=3000)),
            ],
        ),
        migrations.CreateModel(
            name='DeliveryMethod',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='PaymentMethod',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='ProductCategories',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(max_length=250)),
                ('company',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Company')),
            ],
        ),
        migrations.CreateModel(
            name='State',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Products',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.CharField(max_length=250)),
                ('price', models.IntegerField()),
                ('is_available',
                 models.CharField(choices=[('SI', 'Si'), ('NO', 'No')],
                                  default='Si',
                                  max_length=2)),
                ('photo',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.ProductCategories')),
                ('id_company',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Company')),
            ],
        ),
        migrations.CreateModel(
            name='PaymentService',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('payment_date', models.DateField(auto_now_add=True)),
                ('payment_status', models.CharField(max_length=45)),
                ('mount', models.FloatField()),
                ('transaction_date', models.DateField(null=True)),
                ('description', models.CharField(max_length=45)),
                ('period', models.CharField(max_length=45)),
                ('company',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Company')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('retry_in_local', models.BooleanField(default=False)),
                ('total', models.IntegerField()),
                ('address',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='core.AddressSaved')),
                ('client',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Client')),
                ('id_company',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Company')),
                ('payment_method',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.PaymentMethod')),
                ('state',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.State')),
            ],
        ),
        migrations.CreateModel(
            name='MeLiTransaction',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('preference_id', models.CharField(max_length=100)),
                ('payment_id', models.CharField(max_length=45)),
                ('payment_status', models.CharField(max_length=45)),
                ('payment_status_detail', models.CharField(max_length=45)),
                ('merchant_order_id', models.CharField(max_length=45)),
                ('processing_mode', models.CharField(max_length=45)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('payment_service',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.PaymentService')),
            ],
        ),
        migrations.CreateModel(
            name='MeliLinks',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('link', models.CharField(max_length=1024)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('order',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Order')),
            ],
        ),
        migrations.CreateModel(
            name='DetailOrder',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantity', models.IntegerField()),
                ('order',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Order')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='core.Products')),
            ],
        ),
        migrations.AddField(
            model_name='company',
            name='category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='core.CompanyCategory'),
        ),
        migrations.AddField(
            model_name='company',
            name='delivery_method',
            field=models.ManyToManyField(to='core.DeliveryMethod'),
        ),
        migrations.AddField(
            model_name='company',
            name='id_user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='company',
            name='payment_method',
            field=models.ManyToManyField(to='core.PaymentMethod'),
        ),
        migrations.AddField(
            model_name='addresssaved',
            name='client',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='core.Client'),
        ),
    ]
Ejemplo n.º 23
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Card',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('src_id', models.CharField(max_length=30)),
                ('line1', models.CharField(max_length=30)),
                ('line2', models.CharField(blank=True,
                                           max_length=30,
                                           null=True)),
                ('city', models.CharField(max_length=30)),
                ('state', models.CharField(max_length=30)),
                ('zipcode', models.CharField(max_length=20)),
                ('country',
                 django_countries.fields.CountryField(max_length=2)),
                ('first_name', models.CharField(max_length=100)),
                ('last_name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('full_name', models.CharField(default='Guest',
                                               max_length=100)),
                ('email',
                 models.EmailField(blank=True, max_length=50, null=True)),
                ('stripe_customer_id',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('purchase_attempt_time',
                 models.DateTimeField(blank=True, null=True)),
                ('guest_num',
                 models.IntegerField(blank=True, default=0, null=True)),
                ('user',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.PROTECT,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='FilterCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=30, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='FilterName',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=30, unique=True)),
                ('filter_category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='store.filtercategory')),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('description', models.TextField()),
                ('price', models.FloatField(default=0)),
                ('discount_price', models.FloatField(blank=True, null=True)),
                ('quantity', models.IntegerField(default=0)),
                ('image',
                 cloudinary.models.CloudinaryField(blank=True,
                                                   max_length=255,
                                                   null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('total_sold', models.IntegerField(default=0)),
                ('total_earnings', models.IntegerField(default=0)),
                ('daily_earnings', models.IntegerField(default=0)),
                ('weekly_earnings', models.IntegerField(default=0)),
                ('monthly_earnings', models.IntegerField(default=0)),
                ('yearly_earnings', models.IntegerField(default=0)),
                ('filter_name',
                 models.ManyToManyField(blank=True, to='store.FilterName')),
            ],
        ),
        migrations.CreateModel(
            name='ItemCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=30, unique=True)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('date_started',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('is_active', models.BooleanField(default=True)),
                ('total_earnings', models.IntegerField(default=0)),
                ('daily_earnings', models.IntegerField(default=0)),
                ('weekly_earnings', models.IntegerField(default=0)),
                ('monthly_earnings', models.IntegerField(default=0)),
                ('yearly_earnings', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('full_name',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('email', models.CharField(blank=True,
                                           max_length=30,
                                           null=True)),
                ('payment_intent_id',
                 models.CharField(blank=True, max_length=30, null=True)),
                ('ref_code',
                 models.CharField(blank=True, max_length=20, null=True)),
                ('date', models.DateTimeField(blank=True, null=True)),
                ('ordered', models.BooleanField(default=False)),
                ('delivered', models.BooleanField(default=False)),
                ('recieved', models.BooleanField(default=False)),
                ('refund_requested', models.BooleanField(default=False)),
                ('refund_granted', models.BooleanField(default=False)),
                ('cancelled', models.BooleanField(default=False)),
                ('card',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   to='store.card')),
                ('customer',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='store.customer')),
            ],
        ),
        migrations.CreateModel(
            name='ShippingAddress',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('line1', models.CharField(max_length=30)),
                ('line2', models.CharField(blank=True,
                                           max_length=30,
                                           null=True)),
                ('city', models.CharField(max_length=30)),
                ('state', models.CharField(max_length=30)),
                ('zipcode', models.CharField(max_length=30)),
                ('country',
                 django_countries.fields.CountryField(max_length=2)),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('email', models.EmailField(max_length=30)),
                ('customer',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='store.customer')),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantity', models.IntegerField(default=0)),
                ('in_cart', models.BooleanField(default=False)),
                ('ordered', models.BooleanField(default=False)),
                ('customer',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='store.customer')),
                ('item',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='store.item',
                                   verbose_name='Item List')),
                ('order',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='store.order')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='shipping_address',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name='shipping_address',
                to='store.shippingaddress'),
        ),
        migrations.AddField(
            model_name='item',
            name='item_category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                to='store.itemcategory'),
        ),
        migrations.AddField(
            model_name='filtercategory',
            name='item_category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='store.itemcategory'),
        ),
        migrations.AddField(
            model_name='card',
            name='customer',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                to='store.customer'),
        ),
    ]
Ejemplo n.º 24
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Album',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('description', models.TextField(blank=True)),
                ('date', models.DateField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('time', models.DateTimeField()),
                ('text', models.TextField()),
                ('commenter',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Date',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateField()),
                ('reccuring', models.BooleanField()),
                ('name', models.CharField(max_length=32)),
            ],
        ),
        migrations.CreateModel(
            name='Family',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('url_name',
                 models.CharField(db_index=True, max_length=32, unique=True)),
                ('name', models.CharField(max_length=32)),
                ('color',
                 models.CharField(choices=[('amber', 'Amber'),
                                           ('blue', 'Blue'), ('cyan', 'Cyan'),
                                           ('deep-orange', 'Deep Orange'),
                                           ('deep-purple', 'Deep Purple'),
                                           ('green', 'Green'),
                                           ('indigo', 'Indigo'),
                                           ('light-blue', 'Light Blue'),
                                           ('light-green', 'Light Green'),
                                           ('lime', 'Lime'),
                                           ('orange', 'Orange'),
                                           ('pink', 'Pink'),
                                           ('purple', 'Purple'),
                                           ('red', 'Red'), ('teal', 'Teal'),
                                           ('yellow', 'Yellow')],
                                  default='cyan',
                                  max_length=16)),
                ('cloudinary_name', models.CharField(blank=True,
                                                     max_length=32)),
                ('admins',
                 models.ManyToManyField(related_name='admins_of',
                                        to=settings.AUTH_USER_MODEL)),
                ('users',
                 models.ManyToManyField(related_name='families',
                                        to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Families',
            },
        ),
        migrations.CreateModel(
            name='Invite',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email', models.EmailField(max_length=254)),
                ('key', models.CharField(db_index=True, max_length=32)),
                ('family',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Family')),
            ],
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=60)),
                ('address', models.CharField(max_length=80)),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Member',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('address',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Location')),
                ('family',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Family')),
            ],
        ),
        migrations.CreateModel(
            name='PollOption',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('votes', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('posted_at', models.DateTimeField()),
                ('text', models.TextField()),
                ('featured', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-posted_at'],
            },
        ),
        migrations.CreateModel(
            name='Upload',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('is_image', models.BooleanField(default=True)),
                ('date', models.DateTimeField(blank=True, null=True)),
                ('path', cloudinary.models.CloudinaryField(max_length=255)),
                ('family',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Family')),
                ('location',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Location')),
                ('uploader',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='WishList',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=60)),
                ('askers',
                 models.ManyToManyField(related_name='wish_lists',
                                        to=settings.AUTH_USER_MODEL)),
                ('givers',
                 models.ManyToManyField(related_name='giving_to',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='WishListItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('item', models.CharField(max_length=60)),
                ('link', models.URLField(blank=True)),
                ('list',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='book.WishList')),
                ('purchaser',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('post_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='book.Post')),
                ('date', models.DateTimeField()),
                ('name', models.CharField(max_length=32)),
                ('ending_date', models.DateTimeField(null=True)),
                ('image',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Upload')),
                ('location',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Location')),
            ],
            bases=('book.post', ),
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('post_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='book.Post')),
                ('upload',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Upload')),
            ],
            bases=('book.post', ),
        ),
        migrations.CreateModel(
            name='Link',
            fields=[
                ('post_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='book.Post')),
                ('url', models.URLField()),
            ],
            bases=('book.post', ),
        ),
        migrations.CreateModel(
            name='MultiPhoto',
            fields=[
                ('post_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='book.Post')),
                ('images', models.ManyToManyField(to='book.Upload')),
            ],
            bases=('book.post', ),
        ),
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('post_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='book.Post')),
                ('image',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='book.Upload')),
            ],
            bases=('book.post', ),
        ),
        migrations.CreateModel(
            name='Poll',
            fields=[
                ('post_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='book.Post')),
            ],
            bases=('book.post', ),
        ),
        migrations.AddField(
            model_name='post',
            name='family',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='posts',
                to='book.Family'),
        ),
        migrations.AddField(
            model_name='post',
            name='read_by',
            field=models.ManyToManyField(related_name='read_posts',
                                         to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='post',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='member',
            name='photo',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='book.Upload'),
        ),
        migrations.AddField(
            model_name='member',
            name='user',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='invite',
            name='member',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='book.Member'),
        ),
        migrations.AddField(
            model_name='date',
            name='family',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='book.Family'),
        ),
        migrations.AddField(
            model_name='date',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='book.Member'),
        ),
        migrations.AddField(
            model_name='comment',
            name='post',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='book.Post'),
        ),
        migrations.AddField(
            model_name='album',
            name='family',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='book.Family'),
        ),
        migrations.AddField(
            model_name='album',
            name='photos',
            field=models.ManyToManyField(to='book.Upload'),
        ),
        migrations.AddField(
            model_name='polloption',
            name='poll',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='book.Poll'),
        ),
        migrations.AddField(
            model_name='album',
            name='event_at',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='book.Event'),
        ),
    ]
Ejemplo n.º 25
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Delegate',
            fields=[
                ('university',
                 models.CharField(choices=[(None, 'Select'),
                                           ('KU', 'Kenyatta University'),
                                           ('JKUAT', 'JKUAT'),
                                           ('UoN', 'University of Nairobi'),
                                           ('MKU', 'Mount Kenya University'),
                                           ('RU', 'Riara University'),
                                           ('USIU', 'USIU'), ('KCA', 'KCA'),
                                           ('MMU', 'Multimedia University'),
                                           ('SU', 'Strathmore University')],
                                  max_length=5)),
                ('full_name', models.CharField(max_length=35)),
                ('email',
                 django.contrib.postgres.fields.citext.CIEmailField(
                     max_length=254,
                     primary_key=True,
                     serialize=False,
                     validators=[django.core.validators.EmailValidator()])),
                ('phone_number',
                 models.CharField(
                     help_text=
                     'Please use the following format: <em>0712345678</em>.',
                     max_length=12,
                     unique=True,
                     validators=[
                         django.core.validators.MinLengthValidator(10),
                         django.core.validators.MaxLengthValidator(12)
                     ])),
                ('reg_no',
                 django.contrib.postgres.fields.citext.CICharField(
                     max_length=20, unique=True)),
                ('mpesa_code',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Make sure to keep the mpesa message. It will be used to validate your code.',
                     max_length=20,
                     null=True,
                     unique=True)),
                ('has_paid',
                 models.BooleanField(
                     default=False,
                     editable=False,
                     help_text=
                     'Make sure you have confirmed the MPESA code matches from the Safaricom message. For those who have lost the safaricom message, ask them to get an mpesa statement.'
                 )),
            ],
            options={
                'ordering': ['full_name'],
            },
        ),
        migrations.CreateModel(
            name='LipaNaMpesa',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('result_code', models.IntegerField(null=True)),
                ('result_desc', models.CharField(max_length=120, null=True)),
                ('amount', models.FloatField(blank=True, null=True)),
                ('receipt_number',
                 models.CharField(blank=True, max_length=20, null=True)),
                ('transaction_date', models.DateTimeField(blank=True,
                                                          null=True)),
                ('phone_number',
                 models.CharField(blank=True, max_length=13, null=True)),
            ],
            options={
                'verbose_name_plural': 'LipaNaMpesa data',
            },
        ),
        migrations.CreateModel(
            name='Speaker',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True,
                                  help_text='eg <em>Mr, Dr, Prof...</em>.',
                                  max_length=35,
                                  null=True)),
                ('full_name', models.CharField(max_length=35)),
                ('role',
                 models.CharField(blank=True,
                                  help_text='eg <em>CEO Google</em>.',
                                  max_length=100,
                                  null=True)),
                ('photo',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('facebook_url', models.URLField(blank=True, null=True)),
                ('instagram_url', models.URLField(blank=True, null=True)),
                ('twitter_url', models.URLField(blank=True, null=True)),
                ('linkedin_url', models.URLField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Sponsor',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('logo',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
            ],
        ),
        migrations.CreateModel(
            name='SummitDay',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('day_number',
                 models.CharField(blank=True,
                                  choices=[('1', 'ONE'), ('2', 'TWO'),
                                           ('3', 'THREE')],
                                  max_length=5,
                                  null=True)),
                ('date', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='Testimonial',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('statement', models.TextField()),
                ('photo',
                 cloudinary.models.CloudinaryField(max_length=255,
                                                   verbose_name='image')),
                ('who', models.CharField(max_length=40)),
            ],
        ),
        migrations.CreateModel(
            name='Program',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('start_time', models.DateTimeField()),
                ('end_time', models.DateTimeField()),
                ('description', models.TextField()),
                ('venue', models.CharField(max_length=30)),
                ('google_event_id',
                 models.CharField(blank=True, max_length=40, null=True)),
                ('day',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='main.SummitDay')),
                ('speaker',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='main.Speaker')),
            ],
        ),
    ]
Ejemplo n.º 26
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='NewsLetterRecipients',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('email', models.EmailField(max_length=254)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=25, null=True)),
                ('image', cloudinary.models.CloudinaryField(max_length=255, null=True, verbose_name='image')),
                ('link', models.URLField(blank=True, max_length=1000, null=True)),
                ('body', models.TextField(blank=True, max_length=300, null=True)),
                ('design', models.IntegerField(default=0)),
                ('usability', models.IntegerField(default=0)),
                ('content', models.IntegerField(default=0)),
                ('slug', models.SlugField(blank=True, max_length=200, null=True)),
                ('date', models.DateField(auto_now=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('design', models.PositiveIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(10)])),
                ('usability', models.PositiveIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(10)])),
                ('content', models.PositiveIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(10)])),
                ('review', models.TextField(blank=True, max_length=750, null=True)),
                ('review_date', models.DateField(auto_now_add=True)),
                ('rating', models.FloatField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10)])),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='awwards.project')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_image', models.URLField(blank=True, default='https://res.cloudinary.com/mairura/image/upload/w_1000,c_fill,ar_1:1,g_auto,r_max,bo_5px_solid_red,b_rgb:262c35/v1605442723/p3t7keywhkmswljeuu9x.jpg', null=True)),
                ('bio', tinymce.models.HTMLField(blank=True, max_length=150, null=True)),
                ('contact', models.CharField(default=1234567800, max_length=10)),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comments',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comments', models.TextField(max_length=400)),
                ('pro_id', models.IntegerField(default=0)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('commentText', models.TextField()),
                ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
            ],
        ),
        migrations.CreateModel(
            name='DeveloperGame',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('url', models.URLField()),
                ('price', models.FloatField()),
                ('description', models.TextField(default=b'', max_length=300)),
                ('created', models.DateField(default=django.utils.timezone.now, editable=False)),
                ('category', models.CharField(choices=[(b'Action', b'Action'), (b'Adventure', b'Adventure'), (b'Sports', b'Sports'), (b'Strategy', b'Strategy'), (b'Puzzle', b'Puzzle')], default=b'Action', max_length=20)),
                ('image', cloudinary.models.CloudinaryField(max_length=255, verbose_name=b'image')),
            ],
        ),
        migrations.CreateModel(
            name='Gameplay',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.FloatField()),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='awsomeProject.Game')),
            ],
        ),
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', cloudinary.models.CloudinaryField(max_length=255, verbose_name=b'image')),
            ],
        ),
        migrations.CreateModel(
            name='PlayerItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('itemName', models.CharField(max_length=255)),
                ('gameplay', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='awsomeProject.Gameplay')),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rating', models.IntegerField()),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='awsomeProject.Game')),
            ],
        ),
        migrations.CreateModel(
            name='Scores',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.FloatField()),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='awsomeProject.Game')),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='awsomeProject.Game')),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('isDeveloper', models.BooleanField()),
                ('key', models.CharField(default=b'', max_length=300)),
            ],
        ),
        migrations.AddField(
            model_name='transaction',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='scores',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='rating',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='gameplay',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='developergame',
            name='game',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='awsomeProject.Game'),
        ),
        migrations.AddField(
            model_name='developergame',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='comment',
            name='game',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='awsomeProject.Game'),
        ),
        migrations.AddField(
            model_name='comment',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
Ejemplo n.º 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')),
                ('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')),
                ('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')),
                ('first_name', models.CharField(blank=True, max_length=200, null=True)),
                ('last_name', models.CharField(blank=True, max_length=200, null=True)),
                ('phone_number', models.CharField(blank=True, max_length=12, null=True, unique=True)),
                ('whatsapp_number', models.CharField(blank=True, max_length=12, null=True, unique=True)),
                ('is_merchant', models.BooleanField(default=True)),
                ('business_name', models.CharField(blank=True, max_length=200, null=True, unique=True)),
                ('business_description', models.TextField(max_length=300)),
                ('address', models.CharField(blank=True, max_length=200, null=True)),
                ('confirmed_payment', models.BooleanField(default=False)),
                ('date_created', models.DateField(default=django.utils.timezone.now)),
                ('subscription_expired', 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')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('details', models.CharField(default='Default', max_length=200)),
                ('image', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('date_created', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'ordering': ['-date_created'],
            },
        ),
        migrations.CreateModel(
            name='School',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=200, null=True, unique=True)),
                ('alias', models.CharField(blank=True, max_length=200, unique=True)),
                ('state', models.CharField(blank=True, max_length=200, null=True)),
                ('hotspots', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=200), default=list, size=50)),
            ],
        ),
        migrations.CreateModel(
            name='SubCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('date_created', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('dropoff_point', models.CharField(blank=True, max_length=100, null=True)),
                ('name', models.CharField(max_length=70)),
                ('description', models.TextField(max_length=250)),
                ('price', models.FloatField()),
                ('views', models.IntegerField(default=0)),
                ('published_date', models.DateTimeField(default=django.utils.timezone.now)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.SubCategory')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('school', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.School')),
            ],
            options={
                'ordering': ['-published_date'],
            },
        ),
        migrations.AddField(
            model_name='user',
            name='school',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.School'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=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'),
        ),
    ]
Ejemplo n.º 29
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', cloudinary.models.CloudinaryField(max_length=255, verbose_name='gallery/')),
                ('title', models.CharField(max_length=30)),
                ('description', models.CharField(max_length=400)),
                ('url', models.URLField(max_length=400)),
                ('category', models.CharField(max_length=40)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('photo', cloudinary.models.CloudinaryField(default='default.jpeg', max_length=255, verbose_name='gallery/')),
                ('bio', models.CharField(max_length=300)),
                ('name', models.CharField(blank=True, max_length=120)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-pk'],
            },
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('review', models.TextField(blank=True, max_length=500)),
                ('design', models.PositiveSmallIntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10')])),
                ('usability', models.PositiveSmallIntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10')])),
                ('content', models.PositiveSmallIntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10')])),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='review', to='awwards.post')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='review', to='awwards.profile')),
            ],
            options={
                'ordering': ['-pk'],
            },
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('design', models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10')])),
                ('usability', models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10')])),
                ('content', models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '8'), (9, '9'), (10, '10')])),
                ('total', models.FloatField(blank=True, default=0)),
                ('post', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='rating', to='awwards.post')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='rating', to='awwards.profile')),
            ],
        ),
        migrations.AddField(
            model_name='post',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='post', to='awwards.profile'),
        ),
    ]
Ejemplo n.º 30
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('merchant_item_sub_category', '0001_initial'),
        ('merchant_item_category', '0001_initial'),
        ('merchant', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='MerchantItem',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(max_length=500)),
                ('description', models.CharField(max_length=500)),
                ('price_vat_included', models.FloatField(default=0)),
                ('price_vat_excluded', models.FloatField(default=0)),
                ('vat_rate', models.FloatField(default=0.2)),
                ('vat_amount', models.FloatField(default=0)),
                ('article_image',
                 cloudinary.models.CloudinaryField(blank=True,
                                                   max_length=255,
                                                   null=True,
                                                   verbose_name='image')),
                ('status',
                 models.CharField(choices=[('act', 'Active'),
                                           ('tbr', 'To be reviewed by admin'),
                                           ('unv', 'Unavailable'),
                                           ('dlt', 'Deleted')],
                                  default='tbr',
                                  max_length=3)),
                ('display_order', models.IntegerField(default=1)),
                ('has_happy_hour', models.BooleanField(default=False)),
                ('happy_hour_start_hour',
                 models.TimeField(blank=True, null=True)),
                ('happy_hour_end_hour', models.TimeField(blank=True,
                                                         null=True)),
                ('url_tag', models.CharField(max_length=50)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('category',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='merchant_item_category.MerchantItemCategory')),
                ('merchant',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='merchant.Merchant')),
                ('sub_category',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='merchant_item_sub_category.MerchantItemSubCategory')),
            ],
        ),
    ]