Exemple #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('wirecardbackend', '0002_auto_20191021_2134'),
    ]

    operations = [
        migrations.CreateModel(
            name='Buyer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('Name', models.CharField(max_length=200)),
                ('Email', models.EmailField(max_length=200)),
                ('CPF', models.CharField(max_length=11)),
            ],
        ),
        migrations.CreateModel(
            name='Card',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('holder_name', models.CharField(max_length=200)),
                ('number', models.CharField(max_length=16)),
                ('expiration_date',
                 creditcards.models.CardExpiryField(
                     verbose_name='expiration date')),
                ('CVV', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('Amount', models.DecimalField(decimal_places=2,
                                               max_digits=10)),
                ('Type',
                 models.CharField(choices=[(1, 'Boleto'), (2, 'Cartão')],
                                  max_length=1)),
                ('Card',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='wirecardbackend.Card')),
            ],
        ),
    ]
Exemple #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0015_auto_20200516_0635'),
    ]

    operations = [
        migrations.CreateModel(
            name='Membresia',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=10)),
                ('limitePerfiles', models.PositiveSmallIntegerField()),
                ('limiteSesionesActivas', models.PositiveSmallIntegerField()),
                ('precio', models.DecimalField(decimal_places=2, max_digits=10)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('username', models.EmailField(error_messages={'unique': 'Ya existe un usuario registrado con ese email. Por favor, ingrese uno diferente.'}, help_text='Ingrese un email', max_length=150, unique=True, verbose_name='email address')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('credit_Card', creditcards.models.CardNumberField(max_length=25, null=True, unique=True, verbose_name='Número de tarjeta')),
                ('expired_Card', creditcards.models.CardExpiryField(null=True, verbose_name='Fecha de vencimiento')),
                ('secCode_Card', creditcards.models.SecurityCodeField(max_length=4, null=True, verbose_name='Código de seguridad')),
                ('tipo_tarjeta', models.CharField(max_length=60, null=True, verbose_name='Tipo de tarjeta')),
                ('titular', models.CharField(max_length=60, null=True, verbose_name='Nombre del titular de la tarjeta')),
                ('dni', models.IntegerField(null=True, verbose_name='DNI del titular de la tarjeta')),
                ('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')),
                ('subscription', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='users.Membresia')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('card_number', creditcards.models.CardNumberField(max_length=25, null=True)),
                ('cvc', creditcards.models.SecurityCodeField(max_length=4, null=True)),
                ('expiry', creditcards.models.CardExpiryField(null=True)),
                ('brand', models.CharField(blank=True, max_length=10)),
                ('last4', models.CharField(blank=True, max_length=5)),
                ('customer_id', models.CharField(blank=True, max_length=70)),
                ('stripe_id', models.CharField(blank=True, max_length=50)),
                ('token', models.CharField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='CompanionInvite',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email', models.EmailField(max_length=254)),
                ('status', django_enumfield.db.fields.EnumField(default=0, enum=apps.account.enums.CompanionInviteStatus)),
                ('invite_code', models.CharField(max_length=50)),
                ('invited', models.DateTimeField(auto_now_add=True)),
                ('accessed', models.DateTimeField(blank=True, null=True)),
                ('signed_up', models.DateTimeField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='DealWatch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('destination', django.contrib.postgres.fields.jsonb.JSONField()),
                ('max_price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('airlines', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=10), size=None)),
            ],
        ),
        migrations.CreateModel(
            name='FrequentFlyer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('american_airlines', models.CharField(blank=True, max_length=30)),
                ('united_airlines', models.CharField(blank=True, max_length=30)),
                ('southwest_airlines', models.CharField(blank=True, max_length=30)),
                ('sun_country_airlines', models.CharField(blank=True, max_length=30)),
                ('frontier_airlines', models.CharField(blank=True, max_length=30)),
                ('delta_airlines', models.CharField(blank=True, max_length=30)),
                ('alaska_airlines', models.CharField(blank=True, max_length=30)),
                ('jetBlue', models.CharField(blank=True, max_length=30)),
                ('spirit_airlines', models.CharField(blank=True, max_length=30)),
                ('allegiant_air', models.CharField(blank=True, max_length=30)),
                ('hawaiian_airlines', models.CharField(blank=True, max_length=30)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('orders', '0006_auto_20200510_2123'),
    ]

    operations = [
        migrations.RenameField(
            model_name='order',
            old_name='total',
            new_name='sub_total',
        ),
        migrations.AddField(
            model_name='order',
            name='billing_address',
            field=models.CharField(default='', max_length=50),
        ),
        migrations.AddField(
            model_name='order',
            name='card_expiration_date',
            field=creditcards.models.CardExpiryField(null=True),
        ),
        migrations.AddField(
            model_name='order',
            name='card_number',
            field=creditcards.models.CardNumberField(max_length=25, null=True),
        ),
        migrations.AddField(
            model_name='order',
            name='card_security_code',
            field=creditcards.models.SecurityCodeField(max_length=4,
                                                       null=True),
        ),
        migrations.AddField(
            model_name='order',
            name='delivery_address',
            field=models.CharField(default='', max_length=50),
        ),
        migrations.AddField(
            model_name='order',
            name='email',
            field=models.EmailField(default='*****@*****.**',
                                    max_length=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='order',
            name='final_total',
            field=models.DecimalField(decimal_places=2,
                                      default=0.0,
                                      max_digits=6),
        ),
        migrations.AddField(
            model_name='order',
            name='name_on_card',
            field=models.CharField(default='', max_length=50),
        ),
        migrations.AddField(
            model_name='order',
            name='phone',
            field=models.CharField(default='123456789', max_length=15),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='order',
            name='recipient_first_name',
            field=models.CharField(default='', max_length=50),
        ),
        migrations.AddField(
            model_name='order',
            name='recipient_last_name',
            field=models.CharField(default='', max_length=50),
        ),
        migrations.AddField(
            model_name='order',
            name='shipping_cost',
            field=models.DecimalField(decimal_places=2,
                                      default=0.0,
                                      max_digits=6),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Admin',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email', models.CharField(max_length=255)),
                ('password', models.CharField(max_length=255)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Billing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name', models.CharField(max_length=255)),
                ('last_name', models.CharField(max_length=255)),
                ('street', models.TextField()),
                ('city', models.TextField()),
                ('state', models.TextField()),
                ('zipcode', models.TextField()),
                ('cc_number',
                 creditcards.models.CardNumberField(max_length=25)),
                ('cc_expiry', creditcards.models.CardExpiryField()),
                ('cc_code',
                 creditcards.models.SecurityCodeField(max_length=4)),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('category', models.CharField(max_length=255)),
                ('Name', models.CharField(max_length=255)),
                ('Desc', models.TextField()),
                ('Front_pic', models.URLField()),
                ('Back_pic', models.URLField()),
                ('price', models.DecimalField(decimal_places=2, max_digits=8)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('total_price',
                 models.DecimalField(decimal_places=2, max_digits=8)),
                ('status', models.CharField(max_length=255)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('billing',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='orders',
                     to='ecommerceApp.billing')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name', models.CharField(max_length=255)),
                ('last_name', models.CharField(max_length=255)),
                ('email', models.CharField(max_length=255)),
                ('password', models.CharField(max_length=255)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Shipping',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name', models.CharField(max_length=255)),
                ('last_name', models.CharField(max_length=255)),
                ('street', models.TextField()),
                ('city', models.TextField()),
                ('state', models.TextField()),
                ('zipcode', models.TextField()),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='shipping_info',
                                   to='ecommerceApp.user')),
            ],
        ),
        migrations.CreateModel(
            name='Order_item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantity', models.IntegerField()),
                ('sub_total',
                 models.DecimalField(decimal_places=2, max_digits=8)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('item',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='order_items',
                                   to='ecommerceApp.item')),
                ('order',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='order_items',
                                   to='ecommerceApp.order')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='shipping',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='orders',
                to='ecommerceApp.shipping'),
        ),
        migrations.AddField(
            model_name='order',
            name='user',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='orders',
                to='ecommerceApp.user'),
        ),
        migrations.AddField(
            model_name='billing',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='billing_info',
                to='ecommerceApp.user'),
        ),
    ]