class Migration(migrations.Migration):

    dependencies = [("order", "0008_auto_20151026_0820")]

    operations = [
        migrations.RenameField(model_name="order",
                               old_name="total",
                               new_name="total_net"),
        migrations.AddField(
            model_name="order",
            name="total_tax",
            field=django_prices.models.MoneyField(
                decimal_places=2,
                currency=settings.DEFAULT_CURRENCY,
                max_digits=12,
                blank=True,
                null=True,
                verbose_name="total",
            ),
        ),
        migrations.AlterField(
            model_name="deliverygroup",
            name="shipping_method",
            field=models.CharField(default="",
                                   max_length=255,
                                   db_index=True,
                                   blank=True),
        ),
        migrations.AlterField(
            model_name="deliverygroup",
            name="tracking_number",
            field=models.CharField(default="", max_length=255, blank=True),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [("order", "0025_auto_20171214_1015")]

    operations = [
        migrations.AlterModelOptions(name="orderline", options={}),
        migrations.RemoveField(model_name="deliverygroup",
                               name="shipping_price"),
        migrations.AddField(
            model_name="order",
            name="shipping_price",
            field=django_prices.models.MoneyField(
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=4,
                default=0,
                editable=False,
                max_digits=12,
                verbose_name="shipping price",
            ),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="status",
            field=models.CharField(
                choices=[("open", "Open"), ("closed", "Closed")],
                max_length=32,
                verbose_name="order status",
            ),
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

    dependencies = [
        ("discount", "0003_auto_20160207_0534"),
        ("order", "0010_auto_20160119_0541"),
    ]

    operations = [
        migrations.AddField(
            model_name="order",
            name="discount_amount",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="order",
            name="discount_name",
            field=models.CharField(blank=True, default="", max_length=255),
        ),
        migrations.AddField(
            model_name="order",
            name="voucher",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="discount.Voucher",
            ),
        ),
    ]
Пример #4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="GiftCard",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("code",
                 models.CharField(db_index=True, max_length=16, unique=True)),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("start_date", models.DateField(default=datetime.date.today)),
                ("end_date", models.DateField(blank=True, null=True)),
                ("last_used_on", models.DateTimeField(blank=True, null=True)),
                ("is_active", models.BooleanField(default=True)),
                (
                    "initial_balance",
                    django_prices.models.MoneyField(currency="USD",
                                                    decimal_places=2,
                                                    max_digits=12),
                ),
                (
                    "current_balance",
                    django_prices.models.MoneyField(currency="USD",
                                                    decimal_places=2,
                                                    max_digits=12),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="gift_cards",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "permissions": (("manage_gift_card", "Manage gift cards."), )
            },
        )
    ]
Пример #5
0
class Migration(migrations.Migration):

    dependencies = [("product", "0043_auto_20171207_0839")]

    operations = [
        migrations.AlterField(
            model_name="attributechoicevalue",
            name="color",
            field=models.CharField(
                blank=True,
                max_length=7,
                validators=[
                    django.core.validators.RegexValidator(
                        "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$")
                ],
            ),
        ),
        migrations.AlterField(
            model_name="attributechoicevalue",
            name="name",
            field=models.CharField(max_length=100),
        ),
        migrations.AlterField(
            model_name="category",
            name="description",
            field=models.TextField(blank=True),
        ),
        migrations.AlterField(
            model_name="category",
            name="is_hidden",
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(model_name="category",
                              name="name",
                              field=models.CharField(max_length=128)),
        migrations.AlterField(
            model_name="category",
            name="parent",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="children",
                to="product.Category",
            ),
        ),
        migrations.AlterField(model_name="category",
                              name="slug",
                              field=models.SlugField()),
        migrations.AlterField(
            model_name="product",
            name="attributes",
            field=django.contrib.postgres.fields.hstore.HStoreField(
                default={}),
        ),
        migrations.AlterField(
            model_name="product",
            name="available_on",
            field=models.DateField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="product",
            name="categories",
            field=models.ManyToManyField(related_name="products",
                                         to="product.Category"),
        ),
        migrations.AlterField(model_name="product",
                              name="description",
                              field=models.TextField()),
        migrations.AlterField(
            model_name="product",
            name="is_featured",
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(
            model_name="product",
            name="is_published",
            field=models.BooleanField(default=True),
        ),
        migrations.AlterField(model_name="product",
                              name="name",
                              field=models.CharField(max_length=128)),
        migrations.AlterField(
            model_name="product",
            name="price",
            field=django_prices.models.MoneyField(
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12),
        ),
        migrations.AlterField(
            model_name="product",
            name="product_class",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="products",
                to="product.ProductClass",
            ),
        ),
        migrations.AlterField(
            model_name="product",
            name="updated_at",
            field=models.DateTimeField(auto_now=True, null=True),
        ),
        migrations.AlterField(
            model_name="productattribute",
            name="name",
            field=models.CharField(max_length=100),
        ),
        migrations.AlterField(
            model_name="productattribute",
            name="slug",
            field=models.SlugField(unique=True),
        ),
        migrations.AlterField(
            model_name="productclass",
            name="has_variants",
            field=models.BooleanField(default=True),
        ),
        migrations.AlterField(
            model_name="productclass",
            name="is_shipping_required",
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(
            model_name="productclass",
            name="name",
            field=models.CharField(max_length=128),
        ),
        migrations.AlterField(
            model_name="productclass",
            name="product_attributes",
            field=models.ManyToManyField(blank=True,
                                         related_name="products_class",
                                         to="product.ProductAttribute"),
        ),
        migrations.AlterField(
            model_name="productclass",
            name="variant_attributes",
            field=models.ManyToManyField(
                blank=True,
                related_name="product_variants_class",
                to="product.ProductAttribute",
            ),
        ),
        migrations.AlterField(
            model_name="productimage",
            name="alt",
            field=models.CharField(blank=True, max_length=128),
        ),
        migrations.AlterField(
            model_name="productimage",
            name="image",
            field=versatileimagefield.fields.VersatileImageField(
                upload_to="products"),
        ),
        migrations.AlterField(
            model_name="productimage",
            name="order",
            field=models.PositiveIntegerField(editable=False),
        ),
        migrations.AlterField(
            model_name="productimage",
            name="ppoi",
            field=versatileimagefield.fields.PPOIField(default="0.5x0.5",
                                                       editable=False,
                                                       max_length=20),
        ),
        migrations.AlterField(
            model_name="productimage",
            name="product",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="images",
                to="product.Product",
            ),
        ),
        migrations.AlterField(
            model_name="productvariant",
            name="attributes",
            field=django.contrib.postgres.fields.hstore.HStoreField(
                default={}),
        ),
        migrations.AlterField(
            model_name="productvariant",
            name="images",
            field=models.ManyToManyField(through="product.VariantImage",
                                         to="product.ProductImage"),
        ),
        migrations.AlterField(
            model_name="productvariant",
            name="name",
            field=models.CharField(blank=True, max_length=100),
        ),
        migrations.AlterField(
            model_name="productvariant",
            name="price_override",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="productvariant",
            name="sku",
            field=models.CharField(max_length=32, unique=True),
        ),
        migrations.AlterField(
            model_name="stock",
            name="cost_price",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="stock",
            name="quantity",
            field=models.IntegerField(
                default=Decimal("1"),
                validators=[django.core.validators.MinValueValidator(0)],
            ),
        ),
        migrations.AlterField(
            model_name="stock",
            name="quantity_allocated",
            field=models.IntegerField(
                default=Decimal("0"),
                validators=[django.core.validators.MinValueValidator(0)],
            ),
        ),
        migrations.AlterField(
            model_name="stock",
            name="variant",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="stock",
                to="product.ProductVariant",
            ),
        ),
        migrations.AlterField(
            model_name="stocklocation",
            name="name",
            field=models.CharField(max_length=100),
        ),
        migrations.AlterField(
            model_name="variantimage",
            name="image",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="variant_images",
                to="product.ProductImage",
            ),
        ),
        migrations.AlterField(
            model_name="variantimage",
            name="variant",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="variant_images",
                to="product.ProductVariant",
            ),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [("discount", "0003_auto_20160207_0534")]

    operations = [
        migrations.AlterModelOptions(
            name="sale",
            options={"verbose_name": "sale", "verbose_name_plural": "sales"},
        ),
        migrations.AlterModelOptions(
            name="voucher",
            options={"verbose_name": "voucher", "verbose_name_plural": "vouchers"},
        ),
        migrations.AlterField(
            model_name="sale",
            name="categories",
            field=models.ManyToManyField(
                blank=True, to="product.Category", verbose_name="categories"
            ),
        ),
        migrations.AlterField(
            model_name="sale",
            name="name",
            field=models.CharField(max_length=255, verbose_name="name"),
        ),
        migrations.AlterField(
            model_name="sale",
            name="products",
            field=models.ManyToManyField(
                blank=True, to="product.Product", verbose_name="products"
            ),
        ),
        migrations.AlterField(
            model_name="sale",
            name="type",
            field=models.CharField(
                choices=[("fixed", settings.DEFAULT_CURRENCY), ("percentage", "%")],
                default="fixed",
                max_length=10,
                verbose_name="type",
            ),
        ),
        migrations.AlterField(
            model_name="sale",
            name="value",
            field=models.DecimalField(
                decimal_places=2, default=0, max_digits=12, verbose_name="value"
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="apply_to",
            field=models.CharField(
                blank=True, max_length=20, null=True, verbose_name="apply to"
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="category",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="product.Category",
                verbose_name="category",
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="limit",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
                verbose_name="limit",
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="product",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="product.Product",
                verbose_name="product",
            ),
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    dependencies = [
        ("product", "0010_auto_20160129_0826"),
        ("discount", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Voucher",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("product", "Product"),
                            ("category", "Category"),
                            ("shipping", "Shipping"),
                            ("basket", "Baskets over"),
                        ],
                        max_length=20,
                    ),
                ),
                ("name", models.CharField(blank=True,
                                          max_length=255,
                                          null=True)),
                ("code",
                 models.CharField(db_index=True, max_length=12, unique=True)),
                (
                    "usage_limit",
                    models.PositiveIntegerField(blank=True,
                                                help_text="Unlimited if empty",
                                                null=True),
                ),
                ("used", models.PositiveIntegerField(default=0,
                                                     editable=False)),
                ("start_date", models.DateField(default=datetime.date.today)),
                (
                    "end_date",
                    models.DateField(blank=True,
                                     help_text="Never expire if empty",
                                     null=True),
                ),
                (
                    "discount_value_type",
                    models.CharField(
                        choices=[
                            ("fixed", settings.DEFAULT_CURRENCY),
                            ("percentage", "%"),
                        ],
                        default="fixed",
                        max_length=10,
                    ),
                ),
                (
                    "discount_value",
                    models.DecimalField(decimal_places=2, max_digits=12),
                ),
                ("apply_to",
                 models.CharField(blank=True, max_length=20, null=True)),
                (
                    "limit",
                    django_prices.models.MoneyField(
                        blank=True,
                        currency=settings.DEFAULT_CURRENCY,
                        decimal_places=2,
                        max_digits=12,
                        null=True,
                    ),
                ),
                (
                    "category",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="product.Category",
                    ),
                ),
                (
                    "product",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="product.Product",
                    ),
                ),
            ],
        )
    ]
Пример #8
0
class Migration(migrations.Migration):

    dependencies = [("order", "0026_auto_20171218_0428")]

    operations = [
        migrations.AlterField(
            model_name="deliverygroup",
            name="last_updated",
            field=models.DateTimeField(auto_now=True, null=True),
        ),
        migrations.AlterField(
            model_name="deliverygroup",
            name="shipping_method_name",
            field=models.CharField(blank=True,
                                   default=None,
                                   editable=False,
                                   max_length=255,
                                   null=True),
        ),
        migrations.AlterField(
            model_name="deliverygroup",
            name="status",
            field=models.CharField(
                choices=[
                    ("new", "Processing"),
                    ("cancelled", "Cancelled"),
                    ("shipped", "Shipped"),
                ],
                default="new",
                max_length=32,
            ),
        ),
        migrations.AlterField(
            model_name="deliverygroup",
            name="tracking_number",
            field=models.CharField(blank=True, default="", max_length=255),
        ),
        migrations.AlterField(
            model_name="order",
            name="billing_address",
            field=models.ForeignKey(
                editable=False,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="account.Address",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="created",
            field=models.DateTimeField(default=django.utils.timezone.now,
                                       editable=False),
        ),
        migrations.AlterField(
            model_name="order",
            name="discount_amount",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="discount_name",
            field=models.CharField(blank=True, default="", max_length=255),
        ),
        migrations.AlterField(
            model_name="order",
            name="last_status_change",
            field=models.DateTimeField(default=django.utils.timezone.now,
                                       editable=False),
        ),
        migrations.AlterField(
            model_name="order",
            name="shipping_address",
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="account.Address",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="shipping_price",
            field=django_prices.models.MoneyField(
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=4,
                default=0,
                editable=False,
                max_digits=12,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="token",
            field=models.CharField(max_length=36, unique=True),
        ),
        migrations.AlterField(
            model_name="order",
            name="total_net",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="total_tax",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="tracking_client_id",
            field=models.CharField(blank=True, editable=False, max_length=36),
        ),
        migrations.AlterField(
            model_name="order",
            name="user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="orders",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="user_email",
            field=models.EmailField(blank=True,
                                    default="",
                                    editable=False,
                                    max_length=254),
        ),
        migrations.AlterField(
            model_name="order",
            name="voucher",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="discount.Voucher",
            ),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="comment",
            field=models.CharField(blank=True, default="", max_length=100),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="date",
            field=models.DateTimeField(default=django.utils.timezone.now,
                                       editable=False),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="order",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="history",
                to="order.Order",
            ),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="status",
            field=models.CharField(choices=[("open", "Open"),
                                            ("closed", "Closed")],
                                   max_length=32),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="delivery_group",
            field=models.ForeignKey(
                editable=False,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="lines",
                to="order.DeliveryGroup",
            ),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="product",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="product.Product",
            ),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="product_name",
            field=models.CharField(max_length=128),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="product_sku",
            field=models.CharField(max_length=32),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="quantity",
            field=models.IntegerField(validators=[
                django.core.validators.MinValueValidator(0),
                django.core.validators.MaxValueValidator(999),
            ]),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="stock",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="product.Stock",
            ),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="stock_location",
            field=models.CharField(default="", max_length=100),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="unit_price_gross",
            field=models.DecimalField(decimal_places=4, max_digits=12),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="unit_price_net",
            field=models.DecimalField(decimal_places=4, max_digits=12),
        ),
        migrations.AlterField(
            model_name="ordernote",
            name="content",
            field=models.CharField(max_length=250),
        ),
        migrations.AlterField(
            model_name="payment",
            name="order",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="payments",
                to="order.Order",
            ),
        ),
    ]
Пример #9
0
class Migration(migrations.Migration):

    dependencies = [
        ("shipping", "0008_auto_20180108_0814"),
        ("order", "0043_auto_20180322_0655"),
    ]

    operations = [
        migrations.AddField(
            model_name="order",
            name="shipping_method",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="orders",
                to="shipping.ShippingMethodCountry",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="billing_address",
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="account.Address",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="discount_amount",
            field=django_prices.models.MoneyField(
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                default=0,
                max_digits=12,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="shipping_address",
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="account.Address",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="status",
            field=models.CharField(
                choices=[
                    ("draft", "Draft"),
                    ("unfulfilled", "Unfulfilled"),
                    ("partially fulfilled", "Partially fulfilled"),
                    ("fulfilled", "Fulfilled"),
                    ("canceled", "Canceled"),
                ],
                default="unfulfilled",
                max_length=32,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="user_email",
            field=models.EmailField(blank=True, default="", max_length=254),
        ),
    ]
Пример #10
0
class Migration(migrations.Migration):

    dependencies = [("discount", "0006_auto_20171129_1004")]

    operations = [
        migrations.AlterField(
            model_name="sale",
            name="categories",
            field=models.ManyToManyField(blank=True, to="product.Category"),
        ),
        migrations.AlterField(model_name="sale",
                              name="name",
                              field=models.CharField(max_length=255)),
        migrations.AlterField(
            model_name="sale",
            name="products",
            field=models.ManyToManyField(blank=True, to="product.Product"),
        ),
        migrations.AlterField(
            model_name="sale",
            name="type",
            field=models.CharField(
                choices=[("fixed", settings.DEFAULT_CURRENCY),
                         ("percentage", "%")],
                default="fixed",
                max_length=10,
            ),
        ),
        migrations.AlterField(
            model_name="sale",
            name="value",
            field=models.DecimalField(decimal_places=2,
                                      default=0,
                                      max_digits=12),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="apply_to",
            field=models.CharField(blank=True, max_length=20, null=True),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="category",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="product.Category",
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="code",
            field=models.CharField(db_index=True, max_length=12, unique=True),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="discount_value",
            field=models.DecimalField(decimal_places=2, max_digits=12),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="discount_value_type",
            field=models.CharField(
                choices=[("fixed", settings.DEFAULT_CURRENCY),
                         ("percentage", "%")],
                default="fixed",
                max_length=10,
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="end_date",
            field=models.DateField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="limit",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="name",
            field=models.CharField(blank=True, max_length=255, null=True),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="product",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="product.Product",
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="start_date",
            field=models.DateField(default=datetime.date.today),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="type",
            field=models.CharField(
                choices=[
                    ("value", "All purchases"),
                    ("product", "One product"),
                    ("category", "A category of products"),
                    ("shipping", "Shipping"),
                ],
                default="value",
                max_length=20,
            ),
        ),
        migrations.AlterField(
            model_name="voucher",
            name="usage_limit",
            field=models.PositiveIntegerField(blank=True, null=True),
        ),
    ]
Пример #11
0
class Migration(migrations.Migration):

    dependencies = [
        ("product", "0012_auto_20160218_0812"),
        ("discount", "0003_auto_20160207_0534"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    replaces = [("cart", "0001_initial")]

    operations = [
        migrations.CreateModel(
            name="Cart",
            fields=[
                (
                    "status",
                    models.CharField(
                        default="open",
                        max_length=32,
                        verbose_name="order status",
                        choices=[
                            ("open", "Open - currently active"),
                            ("payment", "Waiting for payment"),
                            ("saved",
                             "Saved - for items to be purchased later"),
                            ("ordered",
                             "Submitted - has been ordered at the checkout"),
                            ("checkout",
                             "Checkout - basket is processed in checkout"),
                            ("canceled",
                             "Canceled - basket was canceled by user"),
                        ],
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(auto_now_add=True,
                                         verbose_name="created"),
                ),
                (
                    "last_status_change",
                    models.DateTimeField(auto_now_add=True,
                                         verbose_name="last status change"),
                ),
                ("email",
                 models.EmailField(max_length=254, null=True, blank=True)),
                (
                    "token",
                    models.UUIDField(
                        primary_key=True,
                        default=uuid.uuid4,
                        serialize=False,
                        editable=False,
                        verbose_name="token",
                    ),
                ),
                ("checkout_data", models.TextField(null=True, editable=False)),
                (
                    "total",
                    django_prices.models.MoneyField(
                        default=0,
                        currency=settings.DEFAULT_CURRENCY,
                        max_digits=12,
                        decimal_places=2,
                    ),
                ),
                ("quantity", models.PositiveIntegerField(default=0)),
                (
                    "user",
                    models.ForeignKey(
                        related_name="carts",
                        verbose_name="user",
                        blank=True,
                        to=settings.AUTH_USER_MODEL,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
                (
                    "voucher",
                    models.ForeignKey(
                        related_name="+",
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="discount.Voucher",
                        null=True,
                    ),
                ),
            ],
            options={
                "db_table": "cart_cart",
                "ordering": ("-last_status_change", )
            },
        ),
        migrations.CreateModel(
            name="CartLine",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "quantity",
                    models.PositiveIntegerField(
                        verbose_name="quantity",
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(999),
                        ],
                    ),
                ),
                ("data", models.TextField(default="{}", blank=True)),
                (
                    "cart",
                    models.ForeignKey(
                        related_name="lines",
                        to="checkout.Cart",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
                (
                    "product",
                    models.ForeignKey(
                        related_name="+",
                        verbose_name="product",
                        to="product.ProductVariant",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
            options={"db_table": "cart_cartline"},
        ),
        migrations.AlterUniqueTogether(name="cartline",
                                       unique_together=set([("cart", "product",
                                                             "data")])),
    ]
Пример #12
0
class Migration(migrations.Migration):

    dependencies = [("checkout", "0004_auto_20171129_1004")]

    replaces = [("cart", "0005_auto_20180108_0814")]

    operations = [
        migrations.AlterField(
            model_name="cart",
            name="checkout_data",
            field=fields.JSONField(editable=False, null=True),
        ),
        migrations.AlterField(
            model_name="cart",
            name="created",
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name="cart",
            name="email",
            field=models.EmailField(blank=True, max_length=254, null=True),
        ),
        migrations.AlterField(
            model_name="cart",
            name="last_status_change",
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name="cart",
            name="quantity",
            field=models.PositiveIntegerField(default=0),
        ),
        migrations.AlterField(
            model_name="cart",
            name="status",
            field=models.CharField(
                choices=[
                    ("open", "Open - currently active"),
                    ("payment", "Waiting for payment"),
                    ("saved", "Saved - for items to be purchased later"),
                    ("ordered", "Submitted - an order was placed"),
                    ("checkout", "Checkout - processed in checkout"),
                    ("canceled", "Canceled - canceled by user"),
                ],
                default="open",
                max_length=32,
            ),
        ),
        migrations.AlterField(
            model_name="cart",
            name="token",
            field=models.UUIDField(default=uuid.uuid4,
                                   editable=False,
                                   primary_key=True,
                                   serialize=False),
        ),
        migrations.AlterField(
            model_name="cart",
            name="total",
            field=django_prices.models.MoneyField(
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                default=0,
                max_digits=12,
            ),
        ),
        migrations.AlterField(
            model_name="cart",
            name="user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="carts",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="cart",
            name="voucher",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="discount.Voucher",
            ),
        ),
        migrations.AlterField(
            model_name="cartline",
            name="cart",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="lines",
                to="checkout.Cart",
            ),
        ),
        migrations.AlterField(
            model_name="cartline",
            name="data",
            field=fields.JSONField(blank=True, default=dict),
        ),
        migrations.AlterField(
            model_name="cartline",
            name="quantity",
            field=models.PositiveIntegerField(validators=[
                django.core.validators.MinValueValidator(0),
                django.core.validators.MaxValueValidator(999),
            ]),
        ),
        migrations.AlterField(
            model_name="cartline",
            name="variant",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="product.ProductVariant",
            ),
        ),
    ]
Пример #13
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("product", "0001_initial"),
        ("account", "__first__"),
    ]

    operations = [
        migrations.CreateModel(
            name="DeliveryGroup",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        default="new",
                        max_length=32,
                        verbose_name="delivery status",
                        choices=[
                            ("new", "Processing"),
                            ("cancelled", "Cancelled"),
                            ("shipped", "Shipped"),
                        ],
                    ),
                ),
                (
                    "shipping_required",
                    models.BooleanField(default=True,
                                        verbose_name="shipping required"),
                ),
                (
                    "shipping_price",
                    django_prices.models.MoneyField(
                        decimal_places=4,
                        default=0,
                        editable=False,
                        currency=b"USD",
                        max_digits=12,
                        verbose_name="shipping price",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Order",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        default="new",
                        max_length=32,
                        verbose_name="order status",
                        choices=[
                            ("new", "Processing"),
                            ("cancelled", "Cancelled"),
                            ("payment-pending", "Waiting for payment"),
                            ("fully-paid", "Fully paid"),
                            ("shipped", "Shipped"),
                        ],
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="created",
                        editable=False,
                    ),
                ),
                (
                    "last_status_change",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="last status change",
                        editable=False,
                    ),
                ),
                (
                    "tracking_client_id",
                    models.CharField(max_length=36, editable=False,
                                     blank=True),
                ),
                (
                    "shipping_method",
                    models.CharField(max_length=255,
                                     verbose_name="Delivery method",
                                     blank=True),
                ),
                (
                    "anonymous_user_email",
                    models.EmailField(default="",
                                      max_length=254,
                                      editable=False,
                                      blank=True),
                ),
                (
                    "token",
                    models.CharField(unique=True,
                                     max_length=36,
                                     verbose_name="token"),
                ),
                (
                    "billing_address",
                    models.ForeignKey(
                        related_name="+",
                        editable=False,
                        to="account.Address",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
                (
                    "shipping_address",
                    models.ForeignKey(
                        related_name="+",
                        editable=False,
                        to="account.Address",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        related_name="orders",
                        verbose_name="user",
                        blank=True,
                        to=settings.AUTH_USER_MODEL,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
            options={"ordering": ("-last_status_change", )},
        ),
        migrations.CreateModel(
            name="OrderedItem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "product_name",
                    models.CharField(max_length=128,
                                     verbose_name="product name"),
                ),
                ("product_sku",
                 models.CharField(max_length=32, verbose_name="sku")),
                (
                    "quantity",
                    models.IntegerField(
                        verbose_name="quantity",
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(999),
                        ],
                    ),
                ),
                (
                    "unit_price_net",
                    models.DecimalField(verbose_name="unit price (net)",
                                        max_digits=12,
                                        decimal_places=4),
                ),
                (
                    "unit_price_gross",
                    models.DecimalField(
                        verbose_name="unit price (gross)",
                        max_digits=12,
                        decimal_places=4,
                    ),
                ),
                (
                    "delivery_group",
                    models.ForeignKey(
                        related_name="items",
                        editable=False,
                        to="order.DeliveryGroup",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
                (
                    "product",
                    models.ForeignKey(
                        related_name="+",
                        on_delete=django.db.models.deletion.SET_NULL,
                        verbose_name="product",
                        blank=True,
                        to="product.Product",
                        null=True,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="OrderHistoryEntry",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "date",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="last history change",
                        editable=False,
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        max_length=32,
                        verbose_name="order status",
                        choices=[
                            ("new", "Processing"),
                            ("cancelled", "Cancelled"),
                            ("payment-pending", "Waiting for payment"),
                            ("fully-paid", "Fully paid"),
                            ("shipped", "Shipped"),
                        ],
                    ),
                ),
                ("comment",
                 models.CharField(default="", max_length=100, blank=True)),
                (
                    "order",
                    models.ForeignKey(
                        related_name="history",
                        to="order.Order",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        to=settings.AUTH_USER_MODEL,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
            options={"ordering": ["date"]},
        ),
        migrations.CreateModel(
            name="OrderNote",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                ("date", models.DateTimeField(auto_now_add=True)),
                ("content", models.CharField(max_length=250)),
                (
                    "order",
                    models.ForeignKey(
                        related_name="notes",
                        to="order.Order",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        to=settings.AUTH_USER_MODEL,
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Payment",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                ("variant", models.CharField(max_length=255)),
                (
                    "status",
                    models.CharField(
                        default="waiting",
                        max_length=10,
                        choices=[
                            ("waiting", "Waiting for confirmation"),
                            ("preauth", "Pre-authorized"),
                            ("confirmed", "Confirmed"),
                            ("rejected", "Rejected"),
                            ("refunded", "Refunded"),
                            ("error", "Error"),
                            ("input", "Input"),
                        ],
                    ),
                ),
                (
                    "fraud_status",
                    models.CharField(
                        default="unknown",
                        max_length=10,
                        verbose_name="fraud check",
                        choices=[
                            ("unknown", "Unknown"),
                            ("accept", "Passed"),
                            ("reject", "Rejected"),
                            ("review", "Review"),
                        ],
                    ),
                ),
                ("fraud_message", models.TextField(default="", blank=True)),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                ("transaction_id", models.CharField(max_length=255,
                                                    blank=True)),
                ("currency", models.CharField(max_length=10)),
                (
                    "total",
                    models.DecimalField(default="0.0",
                                        max_digits=9,
                                        decimal_places=2),
                ),
                (
                    "delivery",
                    models.DecimalField(default="0.0",
                                        max_digits=9,
                                        decimal_places=2),
                ),
                (
                    "tax",
                    models.DecimalField(default="0.0",
                                        max_digits=9,
                                        decimal_places=2),
                ),
                ("description", models.TextField(default="", blank=True)),
                ("billing_first_name",
                 models.CharField(max_length=256, blank=True)),
                ("billing_last_name",
                 models.CharField(max_length=256, blank=True)),
                ("billing_address_1",
                 models.CharField(max_length=256, blank=True)),
                ("billing_address_2",
                 models.CharField(max_length=256, blank=True)),
                ("billing_city", models.CharField(max_length=256, blank=True)),
                ("billing_postcode",
                 models.CharField(max_length=256, blank=True)),
                ("billing_country_code",
                 models.CharField(max_length=2, blank=True)),
                ("billing_country_area",
                 models.CharField(max_length=256, blank=True)),
                ("billing_email", models.EmailField(max_length=254,
                                                    blank=True)),
                ("customer_ip_address", models.IPAddressField(blank=True)),
                ("extra_data", models.TextField(default="", blank=True)),
                ("message", models.TextField(default="", blank=True)),
                ("token",
                 models.CharField(default="", max_length=36, blank=True)),
                (
                    "captured_amount",
                    models.DecimalField(default="0.0",
                                        max_digits=9,
                                        decimal_places=2),
                ),
                (
                    "order",
                    models.ForeignKey(
                        related_name="payments",
                        to="order.Order",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
            options={"abstract": False},
        ),
        migrations.AddField(
            model_name="deliverygroup",
            name="order",
            field=models.ForeignKey(
                related_name="groups",
                editable=False,
                to="order.Order",
                on_delete=django.db.models.deletion.CASCADE,
            ),
        ),
    ]
Пример #14
0
class Migration(migrations.Migration):

    dependencies = [
        ("order", "0064_auto_20181016_0819"),
        ("payment", "0002_transfer_payment_to_payment_method"),
    ]

    operations = [
        migrations.AlterField(
            model_name="order",
            name="discount_amount",
            field=django_prices.models.MoneyField(
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                default=app.core.taxes.zero_money,
                max_digits=12,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="total_gross",
            field=django_prices.models.MoneyField(
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                default=app.core.taxes.zero_money,
                max_digits=12,
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="total_net",
            field=django_prices.models.MoneyField(
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                default=app.core.taxes.zero_money,
                max_digits=12,
            ),
        ),
        migrations.RemoveField(model_name="payment", name="order"),
        migrations.DeleteModel(name="Payment"),
        migrations.AlterField(
            model_name="orderevent",
            name="type",
            field=models.CharField(
                choices=[
                    ("PLACED", "placed"),
                    ("PLACED_FROM_DRAFT", "draft_placed"),
                    ("OVERSOLD_ITEMS", "oversold_items"),
                    ("ORDER_MARKED_AS_PAID", "marked_as_paid"),
                    ("CANCELED", "canceled"),
                    ("ORDER_FULLY_PAID", "order_paid"),
                    ("UPDATED", "updated"),
                    ("EMAIL_SENT", "email_sent"),
                    ("PAYMENT_CAPTURED", "captured"),
                    ("PAYMENT_REFUNDED", "refunded"),
                    ("PAYMENT_VOIDED", "voided"),
                    ("FULFILLMENT_CANCELED", "fulfillment_canceled"),
                    ("FULFILLMENT_RESTOCKED_ITEMS", "restocked_items"),
                    ("FULFILLMENT_FULFILLED_ITEMS", "fulfilled_items"),
                    ("TRACKING_UPDATED", "tracking_updated"),
                    ("NOTE_ADDED", "note_added"),
                    ("OTHER", "other"),
                ],
                max_length=255,
            ),
        ),
        migrations.AlterField(
            model_name="orderline",
            name="tax_rate",
            field=models.DecimalField(decimal_places=2,
                                      default=Decimal("0.0"),
                                      max_digits=5),
        ),
    ]
Пример #15
0
class Migration(migrations.Migration):

    dependencies = [("order", "0014_auto_20161028_0955")]

    operations = [
        migrations.AlterModelOptions(
            name="deliverygroup",
            options={
                "verbose_name": "Delivery Group",
                "verbose_name_plural": "Delivery Groups",
            },
        ),
        migrations.AlterModelOptions(
            name="order",
            options={
                "ordering": ("-last_status_change",),
                "verbose_name": "Order",
                "verbose_name_plural": "Orders",
            },
        ),
        migrations.AlterModelOptions(
            name="ordereditem",
            options={
                "verbose_name": "Ordered item",
                "verbose_name_plural": "Ordered items",
            },
        ),
        migrations.AlterModelOptions(
            name="orderhistoryentry",
            options={
                "ordering": ("date",),
                "verbose_name": "Order history entry",
                "verbose_name_plural": "Order history entries",
            },
        ),
        migrations.AlterModelOptions(
            name="ordernote",
            options={
                "verbose_name": "Order note",
                "verbose_name_plural": "Order notes",
            },
        ),
        migrations.AlterModelOptions(
            name="payment",
            options={
                "ordering": ("-pk",),
                "verbose_name": "Payment",
                "verbose_name_plural": "Payments",
            },
        ),
        migrations.AlterField(
            model_name="deliverygroup",
            name="last_updated",
            field=models.DateTimeField(
                auto_now=True, null=True, verbose_name="last updated"
            ),
        ),
        migrations.AlterField(
            model_name="deliverygroup",
            name="shipping_method_name",
            field=models.CharField(
                blank=True,
                default=None,
                editable=False,
                max_length=255,
                null=True,
                verbose_name="shipping method name",
            ),
        ),
        migrations.AlterField(
            model_name="deliverygroup",
            name="tracking_number",
            field=models.CharField(
                blank=True, default="", max_length=255, verbose_name="tracking number"
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="billing_address",
            field=models.ForeignKey(
                editable=False,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="account.Address",
                verbose_name="billing address",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="discount_amount",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
                verbose_name="discount amount",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="discount_name",
            field=models.CharField(
                blank=True, default="", max_length=255, verbose_name="discount name"
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="shipping_address",
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="account.Address",
                verbose_name="shipping address",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="total_net",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
                verbose_name="total net",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="total_tax",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
                verbose_name="total tax",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="tracking_client_id",
            field=models.CharField(
                blank=True,
                editable=False,
                max_length=36,
                verbose_name="tracking client id",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="user_email",
            field=models.EmailField(
                blank=True,
                default="",
                editable=False,
                max_length=254,
                verbose_name="user email",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="voucher",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="discount.Voucher",
                verbose_name="voucher",
            ),
        ),
        migrations.AlterField(
            model_name="ordereditem",
            name="delivery_group",
            field=models.ForeignKey(
                editable=False,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="items",
                to="order.DeliveryGroup",
                verbose_name="delivery group",
            ),
        ),
        migrations.AlterField(
            model_name="ordereditem",
            name="stock",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="product.Stock",
                verbose_name="stock",
            ),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="comment",
            field=models.CharField(
                blank=True, default="", max_length=100, verbose_name="comment"
            ),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="order",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="history",
                to="order.Order",
                verbose_name="order",
            ),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name="user",
            ),
        ),
        migrations.AlterField(
            model_name="payment",
            name="order",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="payments",
                to="order.Order",
                verbose_name="order",
            ),
        ),
    ]
Пример #16
0
class Migration(migrations.Migration):

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="AttributeChoiceValue",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "display",
                    models.CharField(max_length=100, verbose_name="display name"),
                ),
                (
                    "color",
                    models.CharField(
                        blank=True,
                        max_length=7,
                        verbose_name="color",
                        validators=[
                            django.core.validators.RegexValidator(
                                "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
                            )
                        ],
                    ),
                ),
                (
                    "image",
                    versatileimagefield.fields.VersatileImageField(
                        upload_to="attributes",
                        null=True,
                        verbose_name="image",
                        blank=True,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Category",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                ("name", models.CharField(max_length=128, verbose_name="name")),
                ("slug", models.SlugField(verbose_name="slug")),
                (
                    "description",
                    models.TextField(verbose_name="description", blank=True),
                ),
                ("hidden", models.BooleanField(default=False, verbose_name="hidden")),
                ("lft", models.PositiveIntegerField(editable=False, db_index=True)),
                ("rght", models.PositiveIntegerField(editable=False, db_index=True)),
                ("tree_id", models.PositiveIntegerField(editable=False, db_index=True)),
                ("level", models.PositiveIntegerField(editable=False, db_index=True)),
                (
                    "parent",
                    models.ForeignKey(
                        related_name="children",
                        verbose_name="parent",
                        blank=True,
                        to="product.Category",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
            options={"verbose_name_plural": "categories"},
        ),
        migrations.CreateModel(
            name="FixedProductDiscount",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                (
                    "discount",
                    django_prices.models.MoneyField(
                        currency=settings.DEFAULT_CURRENCY,
                        verbose_name="discount value",
                        max_digits=12,
                        decimal_places=2,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Product",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                ("name", models.CharField(max_length=128, verbose_name="name")),
                ("description", models.TextField(verbose_name="description")),
                (
                    "price",
                    django_prices.models.MoneyField(
                        currency=settings.DEFAULT_CURRENCY,
                        verbose_name="price",
                        max_digits=12,
                        decimal_places=2,
                    ),
                ),
                (
                    "weight",
                    models.DecimalField(
                        verbose_name="weight", max_digits=6, decimal_places=2
                    ),
                ),
                (
                    "available_on",
                    models.DateField(
                        null=True, verbose_name="available on", blank=True
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="ProductAttribute",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                ("name", models.SlugField(unique=True, verbose_name="internal name")),
                (
                    "display",
                    models.CharField(max_length=100, verbose_name="display name"),
                ),
            ],
            options={"ordering": ["name"]},
        ),
        migrations.CreateModel(
            name="ProductImage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "image",
                    versatileimagefield.fields.VersatileImageField(
                        upload_to="products"
                    ),
                ),
                (
                    "ppoi",
                    versatileimagefield.fields.PPOIField(
                        default="0.5x0.5", max_length=20, editable=False
                    ),
                ),
                (
                    "alt",
                    models.CharField(
                        max_length=128, verbose_name="short description", blank=True
                    ),
                ),
                ("order", models.PositiveIntegerField(editable=False)),
                (
                    "product",
                    models.ForeignKey(
                        related_name="images",
                        to="product.Product",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
            options={"ordering": ["order"]},
        ),
        migrations.CreateModel(
            name="ProductVariant",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "sku",
                    models.CharField(unique=True, max_length=32, verbose_name="SKU"),
                ),
                (
                    "name",
                    models.CharField(
                        max_length=100, verbose_name="variant name", blank=True
                    ),
                ),
                (
                    "price_override",
                    django_prices.models.MoneyField(
                        decimal_places=2,
                        currency=settings.DEFAULT_CURRENCY,
                        max_digits=12,
                        blank=True,
                        null=True,
                        verbose_name="price override",
                    ),
                ),
                (
                    "weight_override",
                    models.DecimalField(
                        decimal_places=2,
                        max_digits=6,
                        blank=True,
                        null=True,
                        verbose_name="weight override",
                    ),
                ),
                (
                    "attributes",
                    models.TextField(default="{}", verbose_name="attributes"),
                ),
                (
                    "product",
                    models.ForeignKey(
                        related_name="variants",
                        to="product.Product",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Stock",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                ("location", models.CharField(max_length=100, verbose_name="location")),
                (
                    "quantity",
                    models.IntegerField(
                        default=Decimal("1"),
                        verbose_name="quantity",
                        validators=[django.core.validators.MinValueValidator(0)],
                    ),
                ),
                (
                    "cost_price",
                    django_prices.models.MoneyField(
                        decimal_places=2,
                        currency=settings.DEFAULT_CURRENCY,
                        max_digits=12,
                        blank=True,
                        null=True,
                        verbose_name="cost price",
                    ),
                ),
                (
                    "variant",
                    models.ForeignKey(
                        related_name="stock",
                        verbose_name="variant",
                        to="product.ProductVariant",
                        on_delete=django.db.models.deletion.CASCADE,
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="product",
            name="attributes",
            field=models.ManyToManyField(
                related_name="products",
                null=True,
                to="product.ProductAttribute",
                blank=True,
            ),
        ),
        migrations.AddField(
            model_name="product",
            name="categories",
            field=models.ManyToManyField(
                related_name="products",
                verbose_name="categories",
                to="product.Category",
            ),
        ),
        migrations.AddField(
            model_name="fixedproductdiscount",
            name="products",
            field=models.ManyToManyField(to="product.Product", blank=True),
        ),
        migrations.AddField(
            model_name="attributechoicevalue",
            name="attribute",
            field=models.ForeignKey(
                related_name="values",
                to="product.ProductAttribute",
                on_delete=django.db.models.deletion.CASCADE,
            ),
        ),
        migrations.AlterUniqueTogether(
            name="stock", unique_together=set([("variant", "location")])
        ),
    ]
Пример #17
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="ShippingMethod",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=100)),
                ("description", models.TextField(blank=True, default=b"")),
            ],
        ),
        migrations.CreateModel(
            name="ShippingMethodCountry",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "country_code",
                    models.CharField(
                        blank=True,
                        choices=[
                            (b"", b"Any country"),
                            ("AF", "Afghanistan"),
                            ("AX", "\xc5land Islands"),
                            ("AL", "Albania"),
                            ("DZ", "Algeria"),
                            ("AS", "American Samoa"),
                            ("AD", "Andorra"),
                            ("AO", "Angola"),
                            ("AI", "Anguilla"),
                            ("AQ", "Antarctica"),
                            ("AG", "Antigua And Barbuda"),
                            ("AR", "Argentina"),
                            ("AM", "Armenia"),
                            ("AW", "Aruba"),
                            ("AU", "Australia"),
                            ("AT", "Austria"),
                            ("AZ", "Azerbaijan"),
                            ("BS", "Bahamas"),
                            ("BH", "Bahrain"),
                            ("BD", "Bangladesh"),
                            ("BB", "Barbados"),
                            ("BY", "Belarus"),
                            ("BE", "Belgium"),
                            ("BZ", "Belize"),
                            ("BJ", "Benin"),
                            ("BM", "Bermuda"),
                            ("BT", "Bhutan"),
                            ("BO", "Bolivia"),
                            ("BQ", "Bonaire, Saint Eustatius And Saba"),
                            ("BA", "Bosnia And Herzegovina"),
                            ("BW", "Botswana"),
                            ("BV", "Bouvet Island"),
                            ("BR", "Brazil"),
                            ("IO", "British Indian Ocean Territory"),
                            ("BN", "Brunei Darussalam"),
                            ("BG", "Bulgaria"),
                            ("BF", "Burkina Faso"),
                            ("BI", "Burundi"),
                            ("KH", "Cambodia"),
                            ("CM", "Cameroon"),
                            ("CA", "Canada"),
                            ("CV", "Cape Verde"),
                            ("KY", "Cayman Islands"),
                            ("CF", "Central African Republic"),
                            ("TD", "Chad"),
                            ("CL", "Chile"),
                            ("CN", "China"),
                            ("CX", "Christmas Island"),
                            ("CC", "Cocos (Keeling) Islands"),
                            ("CO", "Colombia"),
                            ("KM", "Comoros"),
                            ("CG", "Congo"),
                            ("CD", "Congo, The Democratic Republic of the"),
                            ("CK", "Cook Islands"),
                            ("CR", "Costa Rica"),
                            ("CI", "C\xf4te D'Ivoire"),
                            ("HR", "Croatia"),
                            ("CU", "Cuba"),
                            ("CW", "Cura\xe7o"),
                            ("CY", "Cyprus"),
                            ("CZ", "Czech Republic"),
                            ("DK", "Denmark"),
                            ("DJ", "Djibouti"),
                            ("DM", "Dominica"),
                            ("DO", "Dominican Republic"),
                            ("EC", "Ecuador"),
                            ("EG", "Egypt"),
                            ("SV", "El Salvador"),
                            ("GQ", "Equatorial Guinea"),
                            ("ER", "Eritrea"),
                            ("EE", "Estonia"),
                            ("ET", "Ethiopia"),
                            ("FK", "Falkland Islands (Malvinas)"),
                            ("FO", "Faroe Islands"),
                            ("FJ", "Fiji"),
                            ("FI", "Finland"),
                            ("FR", "France"),
                            ("GF", "French Guiana"),
                            ("PF", "French Polynesia"),
                            ("TF", "French Southern Territories"),
                            ("GA", "Gabon"),
                            ("GM", "Gambia"),
                            ("GE", "Georgia"),
                            ("DE", "Germany"),
                            ("GH", "Ghana"),
                            ("GI", "Gibraltar"),
                            ("GR", "Greece"),
                            ("GL", "Greenland"),
                            ("GD", "Grenada"),
                            ("GP", "Guadeloupe"),
                            ("GU", "Guam"),
                            ("GT", "Guatemala"),
                            ("GG", "Guernsey"),
                            ("GN", "Guinea"),
                            ("GW", "Guinea-Bissau"),
                            ("GY", "Guyana"),
                            ("HT", "Haiti"),
                            ("HM", "Heard Island And Mcdonald Islands"),
                            ("VA", "Holy See (Vatican City State)"),
                            ("HN", "Honduras"),
                            ("HK", "Hong Kong"),
                            ("HU", "Hungary"),
                            ("IS", "Iceland"),
                            ("IN", "India"),
                            ("ID", "Indonesia"),
                            ("IR", "Iran, Islamic Republic of"),
                            ("IQ", "Iraq"),
                            ("IE", "Ireland"),
                            ("IM", "Isle of Man"),
                            ("IL", "Israel"),
                            ("IT", "Italy"),
                            ("JM", "Jamaica"),
                            ("JP", "Japan"),
                            ("JE", "Jersey"),
                            ("JO", "Jordan"),
                            ("KZ", "Kazakhstan"),
                            ("KE", "Kenya"),
                            ("KI", "Kiribati"),
                            ("KP", "Korea, Democratic People's Republic of"),
                            ("KR", "Korea, Republic of"),
                            ("KW", "Kuwait"),
                            ("KG", "Kyrgyzstan"),
                            ("LA", "Lao People's Democratic Republic"),
                            ("LV", "Latvia"),
                            ("LB", "Lebanon"),
                            ("LS", "Lesotho"),
                            ("LR", "Liberia"),
                            ("LY", "Libya"),
                            ("LI", "Liechtenstein"),
                            ("LT", "Lithuania"),
                            ("LU", "Luxembourg"),
                            ("MO", "Macao"),
                            ("MK",
                             "Macedonia, The Former Yugoslav Republic of"),
                            ("MG", "Madagascar"),
                            ("MW", "Malawi"),
                            ("MY", "Malaysia"),
                            ("MV", "Maldives"),
                            ("ML", "Mali"),
                            ("MT", "Malta"),
                            ("MH", "Marshall Islands"),
                            ("MQ", "Martinique"),
                            ("MR", "Mauritania"),
                            ("MU", "Mauritius"),
                            ("YT", "Mayotte"),
                            ("MX", "Mexico"),
                            ("FM", "Micronesia, Federated States of"),
                            ("MD", "Moldova, Republic of"),
                            ("MC", "Monaco"),
                            ("MN", "Mongolia"),
                            ("ME", "Montenegro"),
                            ("MS", "Montserrat"),
                            ("MA", "Morocco"),
                            ("MZ", "Mozambique"),
                            ("MM", "Myanmar"),
                            ("NA", "Namibia"),
                            ("NR", "Nauru"),
                            ("NP", "Nepal"),
                            ("NL", "Netherlands"),
                            ("NC", "New Caledonia"),
                            ("NZ", "New Zealand"),
                            ("NI", "Nicaragua"),
                            ("NE", "Niger"),
                            ("NG", "Nigeria"),
                            ("NU", "Niue"),
                            ("NF", "Norfolk Island"),
                            ("MP", "Northern Mariana Islands"),
                            ("NO", "Norway"),
                            ("OM", "Oman"),
                            ("PK", "Pakistan"),
                            ("PW", "Palau"),
                            ("PS", "Palestinian Territory, Occupied"),
                            ("PA", "Panama"),
                            ("PG", "Papua New Guinea"),
                            ("PY", "Paraguay"),
                            ("PE", "Peru"),
                            ("PH", "Philippines"),
                            ("PN", "Pitcairn"),
                            ("PL", "Poland"),
                            ("PT", "Portugal"),
                            ("PR", "Puerto Rico"),
                            ("QA", "Qatar"),
                            ("RE", "R\xe9union"),
                            ("RO", "Romania"),
                            ("RU", "Russian Federation"),
                            ("RW", "Rwanda"),
                            ("BL", "Saint Barth\xe9lemy"),
                            ("SH",
                             "Saint Helena, Ascension And Tristan Da Cunha"),
                            ("KN", "Saint Kitts And Nevis"),
                            ("LC", "Saint Lucia"),
                            ("MF", "Saint Martin (French Part)"),
                            ("PM", "Saint Pierre And Miquelon"),
                            ("VC", "Saint Vincent And the Grenadines"),
                            ("WS", "Samoa"),
                            ("SM", "San Marino"),
                            ("ST", "Sao Tome And Principe"),
                            ("SA", "Saudi Arabia"),
                            ("SN", "Senegal"),
                            ("RS", "Serbia"),
                            ("SC", "Seychelles"),
                            ("SL", "Sierra Leone"),
                            ("SG", "Singapore"),
                            ("SX", "Sint Maarten (Dutch Part)"),
                            ("SK", "Slovakia"),
                            ("SI", "Slovenia"),
                            ("SB", "Solomon Islands"),
                            ("SO", "Somalia"),
                            ("ZA", "South Africa"),
                            ("GS",
                             "South Georgia and the South Sandwich Islands"),
                            ("ES", "Spain"),
                            ("LK", "Sri Lanka"),
                            ("SD", "Sudan"),
                            ("SR", "Suriname"),
                            ("SJ", "Svalbard and Jan Mayen"),
                            ("SZ", "Swaziland"),
                            ("SE", "Sweden"),
                            ("CH", "Switzerland"),
                            ("SY", "Syria"),
                            ("TW", "Taiwan"),
                            ("TJ", "Tajikistan"),
                            ("TZ", "Tanzania"),
                            ("TH", "Thailand"),
                            ("TL", "Timor-Leste"),
                            ("TG", "Togo"),
                            ("TK", "Tokelau"),
                            ("TO", "Tonga"),
                            ("TT", "Trinidad And Tobago"),
                            ("TN", "Tunisia"),
                            ("TR", "Turkey"),
                            ("TM", "Turkmenistan"),
                            ("TC", "Turks And Caicos Islands"),
                            ("TV", "Tuvalu"),
                            ("UG", "Uganda"),
                            ("UA", "Ukraine"),
                            ("AE", "United Arab Emirates"),
                            ("GB", "United Kingdom"),
                            ("US", "United States"),
                            ("UM", "United States Minor Outlying Islands"),
                            ("UY", "Uruguay"),
                            ("UZ", "Uzbekistan"),
                            ("VU", "Vanuatu"),
                            ("VE", "Venezuela"),
                            ("VN", "Viet Nam"),
                            ("VG", "Virgin Islands, British"),
                            ("VI", "Virgin Islands, U.S."),
                            ("WF", "Wallis And Futuna"),
                            ("EH", "Western Sahara"),
                            ("YE", "Yemen"),
                            ("ZM", "Zambia"),
                            ("ZW", "Zimbabwe"),
                        ],
                        default=b"",
                        max_length=2,
                    ),
                ),
                (
                    "price",
                    django_prices.models.MoneyField(
                        currency=settings.DEFAULT_CURRENCY,
                        decimal_places=2,
                        max_digits=12,
                        verbose_name="price",
                    ),
                ),
                (
                    "shipping_method",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="price_per_country",
                        to="shipping.ShippingMethod",
                    ),
                ),
            ],
            managers=[("object", django.db.models.manager.Manager())],
        ),
        migrations.AlterUniqueTogether(
            name="shippingmethodcountry",
            unique_together=set([("country_code", "shipping_method")]),
        ),
    ]
Пример #18
0
class Migration(migrations.Migration):

    dependencies = [("order", "0012_auto_20160216_1032")]

    operations = [
        migrations.AlterField(
            model_name="deliverygroup",
            name="status",
            field=models.CharField(
                choices=[
                    ("new", "Processing"),
                    ("cancelled", "Cancelled"),
                    ("shipped", "Shipped"),
                    ("payment-pending", "Payment pending"),
                    ("fully-paid", "Fully paid"),
                ],
                default="new",
                max_length=32,
                verbose_name="delivery status",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="status",
            field=models.CharField(
                choices=[
                    ("new", "Processing"),
                    ("cancelled", "Cancelled"),
                    ("shipped", "Shipped"),
                    ("payment-pending", "Payment pending"),
                    ("fully-paid", "Fully paid"),
                ],
                default="new",
                max_length=32,
                verbose_name="order status",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="total_net",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
                verbose_name="total",
            ),
        ),
        migrations.AlterField(
            model_name="order",
            name="total_tax",
            field=django_prices.models.MoneyField(
                blank=True,
                currency=settings.DEFAULT_CURRENCY,
                decimal_places=2,
                max_digits=12,
                null=True,
                verbose_name="total",
            ),
        ),
        migrations.AlterField(
            model_name="orderhistoryentry",
            name="status",
            field=models.CharField(
                choices=[
                    ("new", "Processing"),
                    ("cancelled", "Cancelled"),
                    ("shipped", "Shipped"),
                    ("payment-pending", "Payment pending"),
                    ("fully-paid", "Fully paid"),
                ],
                max_length=32,
                verbose_name="order status",
            ),
        ),
    ]