예제 #1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('tienda', '0010_auto_20210601_0247'),
    ]

    operations = [
        migrations.CreateModel(
            name='ListaDeseos',
            fields=[
                ('id',
                 models.CharField(default=cart.models.generate_uuid,
                                  editable=False,
                                  max_length=10,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('slug',
                 models.SlugField(blank=True,
                                  default=cart.models.get_RandomString,
                                  max_length=5,
                                  unique=True)),
                ('products', models.ManyToManyField(to='tienda.Producto')),
                ('usuario',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ListaCompra',
            fields=[
                ('id',
                 models.CharField(default=cart.models.generate_uuid,
                                  editable=False,
                                  max_length=10,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('slug',
                 models.SlugField(blank=True,
                                  default=cart.models.get_RandomString,
                                  max_length=10,
                                  unique=True)),
                ('products', models.ManyToManyField(to='tienda.Producto')),
                ('usuario',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
예제 #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.FloatField(default=0)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CartItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item_id', models.IntegerField(null=True)),
                ('name', models.CharField(max_length=60)),
                ('price', models.FloatField()),
                ('image', models.FileField(upload_to='user/items/')),
                ('quantity', models.IntegerField()),
                ('status', models.BooleanField(default=False)),
                ('cart', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='items', to='cart.Cart')),
                ('farmer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Farmer')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', max_length=60)),
                ('price', models.FloatField(default=0)),
                ('quantity', models.IntegerField(default=0)),
                ('location', models.CharField(default='', max_length=1000)),
                ('received', models.BooleanField(default=False)),
                ('e', models.CharField(default=cart.models.f, max_length=18)),
                ('farmer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='accounts.Farmer')),
                ('item', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='cart.CartItem')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('total_cost',
                 models.DecimalField(decimal_places=2,
                                     default=cart.models.calculate_total_value,
                                     editable=False,
                                     max_digits=10)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
예제 #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('issues', '0011_auto_20190719_2353'),
    ]

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=40)),
                ('description',
                 tinymce.models.HTMLField(verbose_name='Description')),
                ('request_type',
                 models.CharField(choices=[('new feature', 'New Feature'),
                                           ('feature vote', 'Feature Vote')],
                                  max_length=12)),
                ('amount',
                 models.IntegerField(
                     default=50,
                     validators=[
                         cart.models.Cart.validate_gt_fifty,
                         cart.models.Cart.validate_lt_fifteenhundred
                     ])),
                ('product',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='issues.Issue')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
예제 #5
0
class Migration(migrations.Migration):

    dependencies = [
        ('tienda', '0010_auto_20210601_0247'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('cart', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id',
                 models.CharField(default=cart.models.generate_uuid,
                                  editable=False,
                                  max_length=10,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('slug',
                 models.SlugField(blank=True,
                                  default=cart.models.get_RandomString,
                                  max_length=10,
                                  unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Compras',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('cantidad', models.IntegerField()),
                ('cart',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cart.cart')),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='tienda.producto')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.CharField(default=cart.models.generate_uuid,
                                  editable=False,
                                  max_length=10,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('slug',
                 models.SlugField(blank=True,
                                  default=cart.models.get_RandomString,
                                  max_length=10,
                                  unique=True)),
                ('date', models.DateField()),
                ('products', models.ManyToManyField(to='tienda.Producto')),
            ],
        ),
        migrations.DeleteModel(name='ListaCompra', ),
        migrations.AddField(
            model_name='cart',
            name='products',
            field=models.ManyToManyField(through='cart.Compras',
                                         to='tienda.Producto'),
        ),
        migrations.AddField(
            model_name='cart',
            name='usuario',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
    ]
예제 #6
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='TestProduct',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('product_name',
                 models.CharField(default='This is name of Product',
                                  max_length=255)),
                ('product_img',
                 models.ImageField(
                     upload_to=cart.models.productpic_directory_path)),
                ('product_price', models.FloatField()),
                ('product_discount', models.FloatField(default=20)),
                ('product_sellprice', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='TestProductQuantity',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('avail_quantity', models.IntegerField()),
                ('product',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='cart.testproduct')),
            ],
            options={
                'verbose_name_plural': 'Test Product Quantities',
            },
        ),
        migrations.CreateModel(
            name='ProductCart',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_add', models.DateTimeField(auto_now_add=True)),
                ('date_updated', models.DateTimeField(auto_now=True)),
                ('quantity', models.IntegerField()),
                ('product',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cart.testproduct')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Product cart',
            },
        ),
    ]
예제 #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('id_session', models.CharField(max_length=50)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('value',
                 models.DecimalField(
                     decimal_places=2,
                     default=0,
                     max_digits=10,
                     validators=[cart.models.validate_positive_decimal])),
                ('is_complete', models.BooleanField(default=False)),
                ('payment_method',
                 models.CharField(choices=[('1', 'Μετρητά'),
                                           ('2', 'Τραπεζική Κατάθεση'),
                                           ('3', 'Πιστωτική Κάρτα'),
                                           ('4', 'Paypal')],
                                  default='a',
                                  max_length=1)),
                ('coupon_discount',
                 models.DecimalField(decimal_places=2,
                                     default=0,
                                     max_digits=10)),
                ('final_value',
                 models.DecimalField(decimal_places=2,
                                     default=0,
                                     max_digits=10)),
            ],
            options={
                'ordering': ['-id'],
            },
            managers=[
                ('my_query', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='CartItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('id_session', models.CharField(max_length=50)),
                ('qty', models.PositiveIntegerField(default=1)),
                ('price',
                 models.DecimalField(
                     decimal_places=2,
                     default=0,
                     max_digits=10,
                     validators=[cart.models.validate_positive_decimal])),
                ('price_discount',
                 models.DecimalField(
                     decimal_places=2,
                     default=0,
                     max_digits=10,
                     validators=[cart.models.validate_positive_decimal])),
                ('final_price',
                 models.DecimalField(
                     decimal_places=2,
                     default=0,
                     max_digits=10,
                     validators=[cart.models.validate_positive_decimal])),
            ],
            managers=[
                ('my_query', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='CartRules',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('payment_value', models.PositiveIntegerField(default=0)),
                ('shipping_value', models.PositiveIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('title', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Coupons',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('title', models.CharField(max_length=50, unique=True)),
                ('code', models.CharField(max_length=50,
                                          null=True,
                                          unique=True)),
                ('date_created', models.DateTimeField()),
                ('date_end', models.DateTimeField()),
                ('cart_total_value',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=10,
                                     null=True)),
                ('discount_value',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=10,
                                     null=True)),
                ('discount_percent',
                 models.PositiveIntegerField(blank=True, null=True)),
            ],
            options={
                'verbose_name_plural': 'Coupons',
                'ordering': ['active'],
            },
        ),
        migrations.CreateModel(
            name='Shipping',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('title', models.CharField(max_length=100, unique=True)),
                ('cost',
                 models.DecimalField(
                     decimal_places=2,
                     default=0,
                     max_digits=6,
                     validators=[cart.models.validate_positive_decimal])),
                ('active_cost', models.BooleanField(default=True)),
                ('active_minimum_cost',
                 models.DecimalField(
                     decimal_places=2,
                     default=40,
                     max_digits=6,
                     validators=[cart.models.validate_positive_decimal])),
                ('country',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cart.Country')),
            ],
        ),
    ]
예제 #8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='creation date')),
                ('modified_at',
                 models.DateTimeField(blank=True,
                                      verbose_name='last modification date')),
                ('public_id', models.IntegerField(db_index=True)),
                ('uuid', models.CharField(db_index=True, max_length=128)),
                ('manager_notes', models.TextField(blank=True)),
                ('client_notes', models.TextField(blank=True)),
                ('state',
                 models.IntegerField(choices=[
                     (1, 'Новый'), (2, 'Недозвон'), (3, 'Недозвон_2'),
                     (4, 'Доставка'), (5, 'Согласован'), (6, 'Выполнен'),
                     (7, 'Отменён'), (8, 'Отменён: недозвон'), (9, 'Вручен'),
                     (10, 'Отказ')
                 ],
                                     default=1)),
                ('source',
                 models.IntegerField(choices=[(1, 'Неизвестно'),
                                              (2, 'Корзина'),
                                              (3, 'Быстрая покупка'),
                                              (4, 'Страница категории')],
                                     default=1)),
                ('cart', django.contrib.postgres.fields.jsonb.JSONField()),
                ('location',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=dict)),
                ('customer',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     default=cart.models._empty_customer)),
                ('delivery',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=dict)),
                ('cpa',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=dict)),
                ('store',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=dict)),
                ('tracking',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=dict)),
                ('payment',
                 django.contrib.postgres.fields.jsonb.JSONField(blank=True,
                                                                default=dict)),
                ('user',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]