feat: reset migrations and created customer address model
This commit is contained in:
+263
-90
@@ -1,10 +1,10 @@
|
||||
# Generated by Django 5.0.6 on 2024-05-21 17:19
|
||||
|
||||
import uuid
|
||||
from decimal import Decimal
|
||||
# Generated by Django 5.1.3 on 2024-12-07 08:59
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
import uuid
|
||||
from decimal import Decimal
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("files", "0001_initial"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
@@ -32,19 +33,19 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"name",
|
||||
models.CharField(
|
||||
max_length=100, unique=True, verbose_name="Nombre"
|
||||
max_length=100, unique=True, verbose_name="nombre"
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -68,13 +69,13 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -82,20 +83,20 @@ class Migration(migrations.Migration):
|
||||
models.CharField(
|
||||
max_length=32,
|
||||
unique=True,
|
||||
verbose_name="Documento de identidad",
|
||||
verbose_name="documento de identidad",
|
||||
),
|
||||
),
|
||||
("first_name", models.CharField(max_length=64, verbose_name="Nombre")),
|
||||
("first_name", models.CharField(max_length=64, verbose_name="nombre")),
|
||||
(
|
||||
"last_name",
|
||||
models.CharField(max_length=64, verbose_name="Apellidos"),
|
||||
models.CharField(max_length=64, verbose_name="apellidos"),
|
||||
),
|
||||
("email", models.EmailField(max_length=254, verbose_name="E-mail")),
|
||||
("address", models.CharField(max_length=255, verbose_name="Dirección")),
|
||||
("city", models.CharField(max_length=64, verbose_name="Ciudad")),
|
||||
("state", models.CharField(max_length=64, verbose_name="Región")),
|
||||
("country", models.CharField(max_length=64, verbose_name="País")),
|
||||
("zip", models.CharField(max_length=32, verbose_name="Código postal")),
|
||||
("email", models.EmailField(max_length=254, verbose_name="e-mail")),
|
||||
("address", models.CharField(max_length=255, verbose_name="dirección")),
|
||||
("city", models.CharField(max_length=64, verbose_name="ciudad")),
|
||||
("state", models.CharField(max_length=64, verbose_name="región")),
|
||||
("country", models.CharField(max_length=64, verbose_name="país")),
|
||||
("zip", models.CharField(max_length=32, verbose_name="código postal")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "cliente",
|
||||
@@ -117,13 +118,13 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -131,14 +132,14 @@ class Migration(migrations.Migration):
|
||||
models.CharField(
|
||||
max_length=32,
|
||||
unique=True,
|
||||
verbose_name="Documento de identidad",
|
||||
verbose_name="documento de identidad",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=64, verbose_name="Nombre")),
|
||||
("name", models.CharField(max_length=64, verbose_name="nombre")),
|
||||
(
|
||||
"email",
|
||||
models.EmailField(
|
||||
max_length=254, verbose_name="E-mail de contacto"
|
||||
max_length=254, verbose_name="e-mail de contacto"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -151,11 +152,11 @@ class Migration(migrations.Migration):
|
||||
verbose_name="Teléfono de contacto",
|
||||
),
|
||||
),
|
||||
("address", models.CharField(max_length=255, verbose_name="Dirección")),
|
||||
("city", models.CharField(max_length=64, verbose_name="Ciudad")),
|
||||
("state", models.CharField(max_length=64, verbose_name="Región")),
|
||||
("country", models.CharField(max_length=64, verbose_name="País")),
|
||||
("zip", models.CharField(max_length=32, verbose_name="Código postal")),
|
||||
("address", models.CharField(max_length=255, verbose_name="dirección")),
|
||||
("city", models.CharField(max_length=64, verbose_name="ciudad")),
|
||||
("state", models.CharField(max_length=64, verbose_name="región")),
|
||||
("country", models.CharField(max_length=64, verbose_name="país")),
|
||||
("zip", models.CharField(max_length=32, verbose_name="código postal")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "proveedor",
|
||||
@@ -197,31 +198,141 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"code",
|
||||
models.CharField(
|
||||
max_length=8, unique=True, verbose_name="Código de impuesto"
|
||||
max_length=8, unique=True, verbose_name="código de impuesto"
|
||||
),
|
||||
),
|
||||
(
|
||||
"value",
|
||||
models.PositiveIntegerField(
|
||||
verbose_name="Valor entero (porcentaje)"
|
||||
verbose_name="valor entero (porcentaje)"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "impuesto",
|
||||
"verbose_name_plural": "impuestos",
|
||||
"ordering": ("id",),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Cart",
|
||||
fields=[
|
||||
(
|
||||
"uuid",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="uuid",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name="usuario",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "carrito",
|
||||
"verbose_name_plural": "carritos",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="CustomerAddress",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"vat_id",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
default="",
|
||||
max_length=16,
|
||||
null=True,
|
||||
verbose_name="número de identificación fiscal",
|
||||
),
|
||||
),
|
||||
("address", models.CharField(max_length=128, verbose_name="dirección")),
|
||||
(
|
||||
"address_town",
|
||||
models.CharField(max_length=64, verbose_name="localidad"),
|
||||
),
|
||||
(
|
||||
"address_zip",
|
||||
models.CharField(max_length=16, verbose_name="código postal"),
|
||||
),
|
||||
(
|
||||
"address_state",
|
||||
models.CharField(max_length=64, verbose_name="provincia"),
|
||||
),
|
||||
(
|
||||
"address_country",
|
||||
models.CharField(
|
||||
default="ESPAÑA", max_length=64, verbose_name="país"
|
||||
),
|
||||
),
|
||||
(
|
||||
"address_phone",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
default="",
|
||||
max_length=16,
|
||||
null=True,
|
||||
verbose_name="teléfono",
|
||||
),
|
||||
),
|
||||
(
|
||||
"address_type",
|
||||
models.CharField(
|
||||
choices=[("BILL", "facturación"), ("SHIP", "envío")],
|
||||
default="SHIP",
|
||||
max_length=4,
|
||||
verbose_name="tipo de dirección",
|
||||
),
|
||||
),
|
||||
("default", models.BooleanField(default=True)),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name="usuario",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "dirección de cliente",
|
||||
"verbose_name_plural": "direcciones de cliente",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@@ -239,13 +350,13 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -257,7 +368,7 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"status",
|
||||
models.CharField(
|
||||
default="PEN", max_length=3, verbose_name="Estado"
|
||||
default="PEN", max_length=3, verbose_name="estado"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -266,7 +377,7 @@ class Migration(migrations.Migration):
|
||||
decimal_places=2,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="Base imponible",
|
||||
verbose_name="base imponible",
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -275,69 +386,69 @@ class Migration(migrations.Migration):
|
||||
decimal_places=2,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="Total",
|
||||
verbose_name="total",
|
||||
),
|
||||
),
|
||||
(
|
||||
"billing_address",
|
||||
models.CharField(
|
||||
max_length=255, verbose_name="Dirección de facturación"
|
||||
max_length=255, verbose_name="dirección de facturación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"billing_city",
|
||||
models.CharField(
|
||||
max_length=64, verbose_name="Ciudad de facturación"
|
||||
max_length=64, verbose_name="ciudad de facturación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"billing_state",
|
||||
models.CharField(
|
||||
max_length=64, verbose_name="Región de facturación"
|
||||
max_length=64, verbose_name="región de facturación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"billing_country",
|
||||
models.CharField(max_length=64, verbose_name="País de facturación"),
|
||||
models.CharField(max_length=64, verbose_name="país de facturación"),
|
||||
),
|
||||
(
|
||||
"billing_zip",
|
||||
models.CharField(
|
||||
max_length=32, verbose_name="Código postal de facturación"
|
||||
max_length=32, verbose_name="código postal de facturación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"shipping_address",
|
||||
models.CharField(max_length=255, verbose_name="Dirección"),
|
||||
models.CharField(max_length=255, verbose_name="dirección"),
|
||||
),
|
||||
(
|
||||
"shipping_city",
|
||||
models.CharField(max_length=64, verbose_name="Ciudad"),
|
||||
models.CharField(max_length=64, verbose_name="ciudad"),
|
||||
),
|
||||
(
|
||||
"shipping_state",
|
||||
models.CharField(max_length=64, verbose_name="Región"),
|
||||
models.CharField(max_length=64, verbose_name="región"),
|
||||
),
|
||||
(
|
||||
"shipping_country",
|
||||
models.CharField(max_length=64, verbose_name="País"),
|
||||
models.CharField(max_length=64, verbose_name="país"),
|
||||
),
|
||||
(
|
||||
"shipping_zip",
|
||||
models.CharField(max_length=32, verbose_name="Código postal"),
|
||||
models.CharField(max_length=32, verbose_name="código postal"),
|
||||
),
|
||||
(
|
||||
"contact_phone",
|
||||
models.CharField(
|
||||
blank=True, max_length=32, verbose_name="Teléfono de contacto"
|
||||
blank=True, max_length=32, verbose_name="teléfono de contacto"
|
||||
),
|
||||
),
|
||||
(
|
||||
"customer",
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="shop.customer",
|
||||
verbose_name="Cliente",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name="cliente",
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -361,29 +472,26 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"sku",
|
||||
models.CharField(
|
||||
max_length=64, unique=True, verbose_name="Código de referencia"
|
||||
max_length=64, unique=True, verbose_name="código de referencia"
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=96, verbose_name="Nombre")),
|
||||
("name", models.CharField(max_length=96, verbose_name="nombre")),
|
||||
(
|
||||
"description",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
default="",
|
||||
max_length=1000,
|
||||
verbose_name="Descripción",
|
||||
models.TextField(
|
||||
blank=True, default="", verbose_name="descripción"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -392,11 +500,26 @@ class Migration(migrations.Migration):
|
||||
decimal_places=4,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="Stock",
|
||||
verbose_name="stock",
|
||||
),
|
||||
),
|
||||
(
|
||||
"is_digital_asset",
|
||||
models.BooleanField(
|
||||
default=False, verbose_name="es un activo digital"
|
||||
),
|
||||
),
|
||||
("is_digital_asset", models.BooleanField(default=False)),
|
||||
("url", models.URLField(blank=True, verbose_name="URL de descarga")),
|
||||
(
|
||||
"slug",
|
||||
models.SlugField(
|
||||
blank=True,
|
||||
default="",
|
||||
max_length=128,
|
||||
null=True,
|
||||
verbose_name="Slug",
|
||||
),
|
||||
),
|
||||
(
|
||||
"brand",
|
||||
models.ForeignKey(
|
||||
@@ -404,26 +527,26 @@ class Migration(migrations.Migration):
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="shop.brand",
|
||||
verbose_name="Marca",
|
||||
verbose_name="marca",
|
||||
),
|
||||
),
|
||||
(
|
||||
"images",
|
||||
models.ManyToManyField(
|
||||
blank=True, to="files.fileupload", verbose_name="Imágenes"
|
||||
blank=True, to="files.fileupload", verbose_name="imágenes"
|
||||
),
|
||||
),
|
||||
(
|
||||
"tags",
|
||||
models.ManyToManyField(
|
||||
blank=True, to="shop.tag", verbose_name="Etiquetas"
|
||||
blank=True, to="shop.tag", verbose_name="etiquetas"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "producto",
|
||||
"verbose_name_plural": "productos",
|
||||
"ordering": ("-id",),
|
||||
"ordering": ("id",),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@@ -441,13 +564,13 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -456,13 +579,13 @@ class Migration(migrations.Migration):
|
||||
decimal_places=4,
|
||||
default=Decimal("1"),
|
||||
max_digits=13,
|
||||
verbose_name="Cantidad",
|
||||
verbose_name="cantidad",
|
||||
),
|
||||
),
|
||||
(
|
||||
"price",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Precio"
|
||||
decimal_places=4, max_digits=13, verbose_name="precio"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -471,23 +594,23 @@ class Migration(migrations.Migration):
|
||||
decimal_places=4,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="Total sin impuestos",
|
||||
verbose_name="total sin impuestos",
|
||||
),
|
||||
),
|
||||
(
|
||||
"tax_value",
|
||||
models.PositiveIntegerField(verbose_name="Valor de impuestos"),
|
||||
models.PositiveIntegerField(verbose_name="valor de impuestos"),
|
||||
),
|
||||
(
|
||||
"taxes",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Impuestos"
|
||||
decimal_places=4, max_digits=13, verbose_name="impuestos"
|
||||
),
|
||||
),
|
||||
(
|
||||
"total",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Total"
|
||||
decimal_places=4, max_digits=13, verbose_name="total"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -496,7 +619,7 @@ class Migration(migrations.Migration):
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="lines",
|
||||
to="shop.order",
|
||||
verbose_name="Pedido",
|
||||
verbose_name="pedido",
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -504,7 +627,7 @@ class Migration(migrations.Migration):
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="shop.product",
|
||||
verbose_name="Producto",
|
||||
verbose_name="producto",
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -513,6 +636,45 @@ class Migration(migrations.Migration):
|
||||
"verbose_name_plural": "líneas de pedido",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="CartItem",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"quantity",
|
||||
models.PositiveIntegerField(default=1, verbose_name="cantidad"),
|
||||
),
|
||||
(
|
||||
"cart",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="items",
|
||||
to="shop.cart",
|
||||
verbose_name="carrito",
|
||||
),
|
||||
),
|
||||
(
|
||||
"product",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="shop.product",
|
||||
verbose_name="producto",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "línea de carrito",
|
||||
"verbose_name_plural": "líneas de carrito",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="ProductBatch",
|
||||
fields=[
|
||||
@@ -528,19 +690,19 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"code",
|
||||
models.CharField(
|
||||
db_index=True, max_length=32, unique=True, verbose_name="Código"
|
||||
db_index=True, max_length=32, unique=True, verbose_name="código"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -549,7 +711,7 @@ class Migration(migrations.Migration):
|
||||
decimal_places=4,
|
||||
default=Decimal("1"),
|
||||
max_digits=13,
|
||||
verbose_name="Cantidad",
|
||||
verbose_name="cantidad",
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -557,7 +719,7 @@ class Migration(migrations.Migration):
|
||||
models.DateField(
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name="Fecha de caducidad / consumo preferente",
|
||||
verbose_name="fecha de caducidad / consumo preferente",
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -565,7 +727,7 @@ class Migration(migrations.Migration):
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="shop.product",
|
||||
verbose_name="Producto",
|
||||
verbose_name="producto",
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -575,7 +737,7 @@ class Migration(migrations.Migration):
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="shop.provider",
|
||||
verbose_name="Proveedor",
|
||||
verbose_name="proveedor",
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -599,31 +761,41 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"price",
|
||||
models.DecimalField(
|
||||
decimal_places=2, max_digits=11, verbose_name="Precio"
|
||||
decimal_places=2, max_digits=11, verbose_name="precio"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date",
|
||||
models.DateTimeField(
|
||||
default=django.utils.timezone.now, verbose_name="Fecha"
|
||||
default=django.utils.timezone.now, verbose_name="fecha"
|
||||
),
|
||||
),
|
||||
(
|
||||
"price_with_tax",
|
||||
models.DecimalField(
|
||||
blank=True,
|
||||
decimal_places=2,
|
||||
max_digits=11,
|
||||
null=True,
|
||||
verbose_name="precio con impuestos",
|
||||
),
|
||||
),
|
||||
(
|
||||
"current",
|
||||
models.BooleanField(
|
||||
default=False, verbose_name="Es el precio actual"
|
||||
default=False, verbose_name="es el precio actual"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -632,7 +804,7 @@ class Migration(migrations.Migration):
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="prices",
|
||||
to="shop.product",
|
||||
verbose_name="Producto",
|
||||
verbose_name="producto",
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -640,13 +812,14 @@ class Migration(migrations.Migration):
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="shop.tax",
|
||||
verbose_name="Impuesto aplicable",
|
||||
verbose_name="impuesto aplicable",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "precio de producto",
|
||||
"verbose_name_plural": "precio de producto",
|
||||
"ordering": ("-date",),
|
||||
},
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# Generated by Django 5.0.6 on 2024-05-26 11:16
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("shop", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="productprice",
|
||||
options={
|
||||
"ordering": ("-date",),
|
||||
"verbose_name": "precio de producto",
|
||||
"verbose_name_plural": "precio de producto",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="tax",
|
||||
options={
|
||||
"ordering": ("id",),
|
||||
"verbose_name": "impuesto",
|
||||
"verbose_name_plural": "impuestos",
|
||||
},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="description",
|
||||
field=models.TextField(blank=True, default="", verbose_name="Descripción"),
|
||||
),
|
||||
]
|
||||
@@ -1,555 +0,0 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-02 19:47
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("files", "0001_initial"),
|
||||
("shop", "0002_alter_productprice_options_alter_tax_options_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="brand",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="brand",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="brand",
|
||||
name="name",
|
||||
field=models.CharField(max_length=100, unique=True, verbose_name="nombre"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="address",
|
||||
field=models.CharField(max_length=255, verbose_name="dirección"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="city",
|
||||
field=models.CharField(max_length=64, verbose_name="ciudad"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="country",
|
||||
field=models.CharField(max_length=64, verbose_name="país"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="email",
|
||||
field=models.EmailField(max_length=254, verbose_name="e-mail"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="first_name",
|
||||
field=models.CharField(max_length=64, verbose_name="nombre"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="last_name",
|
||||
field=models.CharField(max_length=64, verbose_name="apellidos"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="state",
|
||||
field=models.CharField(max_length=64, verbose_name="región"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="vat_id",
|
||||
field=models.CharField(
|
||||
max_length=32, unique=True, verbose_name="documento de identidad"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customer",
|
||||
name="zip",
|
||||
field=models.CharField(max_length=32, verbose_name="código postal"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="base_total",
|
||||
field=models.DecimalField(
|
||||
decimal_places=2,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="base imponible",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="billing_address",
|
||||
field=models.CharField(
|
||||
max_length=255, verbose_name="dirección de facturación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="billing_city",
|
||||
field=models.CharField(max_length=64, verbose_name="ciudad de facturación"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="billing_country",
|
||||
field=models.CharField(max_length=64, verbose_name="país de facturación"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="billing_state",
|
||||
field=models.CharField(max_length=64, verbose_name="región de facturación"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="billing_zip",
|
||||
field=models.CharField(
|
||||
max_length=32, verbose_name="código postal de facturación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="contact_phone",
|
||||
field=models.CharField(
|
||||
blank=True, max_length=32, verbose_name="teléfono de contacto"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="customer",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="shop.customer",
|
||||
verbose_name="cliente",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="shipping_address",
|
||||
field=models.CharField(max_length=255, verbose_name="dirección"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="shipping_city",
|
||||
field=models.CharField(max_length=64, verbose_name="ciudad"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="shipping_country",
|
||||
field=models.CharField(max_length=64, verbose_name="país"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="shipping_state",
|
||||
field=models.CharField(max_length=64, verbose_name="región"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="shipping_zip",
|
||||
field=models.CharField(max_length=32, verbose_name="código postal"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="status",
|
||||
field=models.CharField(default="PEN", max_length=3, verbose_name="estado"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
name="total",
|
||||
field=models.DecimalField(
|
||||
decimal_places=2,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="total",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="base_total",
|
||||
field=models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="total sin impuestos",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="order",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="lines",
|
||||
to="shop.order",
|
||||
verbose_name="pedido",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="price",
|
||||
field=models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="precio"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="product",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="shop.product",
|
||||
verbose_name="producto",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="quantity",
|
||||
field=models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("1"),
|
||||
max_digits=13,
|
||||
verbose_name="cantidad",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="tax_value",
|
||||
field=models.PositiveIntegerField(verbose_name="valor de impuestos"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="taxes",
|
||||
field=models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="impuestos"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="orderline",
|
||||
name="total",
|
||||
field=models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="total"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="brand",
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="shop.brand",
|
||||
verbose_name="marca",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="description",
|
||||
field=models.TextField(blank=True, default="", verbose_name="descripción"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="images",
|
||||
field=models.ManyToManyField(
|
||||
blank=True, to="files.fileupload", verbose_name="imágenes"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="is_digital_asset",
|
||||
field=models.BooleanField(
|
||||
default=False, verbose_name="es un activo digital"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="name",
|
||||
field=models.CharField(max_length=96, verbose_name="nombre"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="sku",
|
||||
field=models.CharField(
|
||||
max_length=64, unique=True, verbose_name="código de referencia"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="stock",
|
||||
field=models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="stock",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="product",
|
||||
name="tags",
|
||||
field=models.ManyToManyField(
|
||||
blank=True, to="shop.tag", verbose_name="etiquetas"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productbatch",
|
||||
name="code",
|
||||
field=models.CharField(
|
||||
db_index=True, max_length=32, unique=True, verbose_name="código"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productbatch",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productbatch",
|
||||
name="expiration_date",
|
||||
field=models.DateField(
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name="fecha de caducidad / consumo preferente",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productbatch",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productbatch",
|
||||
name="product",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="shop.product",
|
||||
verbose_name="producto",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productbatch",
|
||||
name="provider",
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="shop.provider",
|
||||
verbose_name="proveedor",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productbatch",
|
||||
name="quantity",
|
||||
field=models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("1"),
|
||||
max_digits=13,
|
||||
verbose_name="cantidad",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productprice",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productprice",
|
||||
name="current",
|
||||
field=models.BooleanField(
|
||||
default=False, verbose_name="es el precio actual"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productprice",
|
||||
name="date",
|
||||
field=models.DateTimeField(
|
||||
default=django.utils.timezone.now, verbose_name="fecha"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productprice",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productprice",
|
||||
name="price",
|
||||
field=models.DecimalField(
|
||||
decimal_places=2, max_digits=11, verbose_name="precio"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productprice",
|
||||
name="product",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="prices",
|
||||
to="shop.product",
|
||||
verbose_name="producto",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="productprice",
|
||||
name="tax",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="shop.tax",
|
||||
verbose_name="impuesto aplicable",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="address",
|
||||
field=models.CharField(max_length=255, verbose_name="dirección"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="city",
|
||||
field=models.CharField(max_length=64, verbose_name="ciudad"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="country",
|
||||
field=models.CharField(max_length=64, verbose_name="país"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="email",
|
||||
field=models.EmailField(max_length=254, verbose_name="e-mail de contacto"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="name",
|
||||
field=models.CharField(max_length=64, verbose_name="nombre"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="state",
|
||||
field=models.CharField(max_length=64, verbose_name="región"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="vat_id",
|
||||
field=models.CharField(
|
||||
max_length=32, unique=True, verbose_name="documento de identidad"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="provider",
|
||||
name="zip",
|
||||
field=models.CharField(max_length=32, verbose_name="código postal"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tax",
|
||||
name="code",
|
||||
field=models.CharField(
|
||||
max_length=8, unique=True, verbose_name="código de impuesto"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tax",
|
||||
name="creation_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tax",
|
||||
name="last_modification_date",
|
||||
field=models.DateTimeField(
|
||||
auto_now=True, verbose_name="fecha de última modificación"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="tax",
|
||||
name="value",
|
||||
field=models.PositiveIntegerField(verbose_name="valor entero (porcentaje)"),
|
||||
),
|
||||
]
|
||||
@@ -1,40 +0,0 @@
|
||||
# Generated by Django 5.1.3 on 2024-11-22 19:53
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.utils.text import slugify
|
||||
|
||||
|
||||
def add_product_slug(apps, schema_editor):
|
||||
Product = apps.get_model("shop", "Product")
|
||||
|
||||
for product in Product.objects.all():
|
||||
product.slug = slugify(product.name)[:128]
|
||||
product.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("shop", "0003_alter_brand_creation_date_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="product",
|
||||
options={
|
||||
"ordering": ("id",),
|
||||
"verbose_name": "producto",
|
||||
"verbose_name_plural": "productos",
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="product",
|
||||
name="slug",
|
||||
field=models.SlugField(
|
||||
blank=True, default="", max_length=128, null=True, verbose_name="Slug"
|
||||
),
|
||||
),
|
||||
migrations.RunPython(
|
||||
add_product_slug,
|
||||
),
|
||||
]
|
||||
@@ -1,24 +0,0 @@
|
||||
# Generated by Django 5.1.3 on 2024-11-24 12:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("shop", "0004_alter_product_options_product_slug"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="productprice",
|
||||
name="price_with_tax",
|
||||
field=models.DecimalField(
|
||||
blank=True,
|
||||
decimal_places=2,
|
||||
max_digits=11,
|
||||
null=True,
|
||||
verbose_name="precio con impuestos",
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -1,91 +0,0 @@
|
||||
# Generated by Django 5.1.3 on 2024-11-27 12:10
|
||||
|
||||
import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("shop", "0005_productprice_price_with_tax"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Cart",
|
||||
fields=[
|
||||
(
|
||||
"uuid",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="uuid",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name="usuario",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "carrito",
|
||||
"verbose_name_plural": "carritos",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="CartItem",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"quantity",
|
||||
models.PositiveIntegerField(default=1, verbose_name="cantidad"),
|
||||
),
|
||||
(
|
||||
"cart",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="items",
|
||||
to="shop.cart",
|
||||
verbose_name="carrito",
|
||||
),
|
||||
),
|
||||
(
|
||||
"product",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="shop.product",
|
||||
verbose_name="producto",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "línea de carrito",
|
||||
"verbose_name_plural": "líneas de carrito",
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user