restore composer.json, add mysqli extension

This commit is contained in:
2026-04-13 17:12:58 +05:00
parent e0fe9bd156
commit 2154e97801
7 changed files with 198 additions and 1 deletions

View File

@@ -0,0 +1,63 @@
# Generated by Django 6.0.4 on 2026-04-13 12:09
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("vendors", "0005_vendorproductmodel_product_specification"),
]
operations = [
migrations.CreateModel(
name="ProductAttributeModel",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"firestore_id",
models.CharField(blank=True, max_length=255, null=True, unique=True, verbose_name="firestore id"),
),
("name", models.CharField(max_length=255, verbose_name="name")),
],
options={
"verbose_name": "Product Attribute",
"verbose_name_plural": "Product Attributes",
"db_table": "product_attributes",
},
),
migrations.CreateModel(
name="ProductVariantModel",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"firestore_id",
models.CharField(blank=True, max_length=255, null=True, unique=True, verbose_name="firestore id"),
),
("price", models.DecimalField(decimal_places=2, default=0, max_digits=12, verbose_name="price")),
("sku", models.CharField(blank=True, max_length=255, null=True, verbose_name="SKU")),
("quantity", models.IntegerField(default=-1, verbose_name="quantity")),
("image_url", models.URLField(blank=True, max_length=1000, null=True, verbose_name="image url")),
("attribute_data", models.JSONField(blank=True, null=True, verbose_name="attribute data")),
(
"product",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="variants",
to="vendors.vendorproductmodel",
verbose_name="product",
),
),
],
options={
"verbose_name": "Product Variant",
"verbose_name_plural": "Product Variants",
"db_table": "product_variants",
},
),
]

View File

@@ -2,3 +2,5 @@ from .category import * # noqa
from .vendor import * # noqa
from .vendor_product import * # noqa
from .section import * # noqa
from .product_attribute import * # noqa
from .product_variant import * # noqa

View File

@@ -0,0 +1,16 @@
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_core.models import AbstractBaseModel
class ProductAttributeModel(AbstractBaseModel):
firestore_id = models.CharField(verbose_name=_("firestore id"), max_length=255, unique=True, null=True, blank=True)
name = models.CharField(verbose_name=_("name"), max_length=255)
def __str__(self):
return self.name
class Meta:
db_table = "product_attributes"
verbose_name = _("Product Attribute")
verbose_name_plural = _("Product Attributes")

View File

@@ -0,0 +1,26 @@
from django.db import models
from django.utils.translation import gettext_lazy as _
from django_core.models import AbstractBaseModel
class ProductVariantModel(AbstractBaseModel):
product = models.ForeignKey(
"VendorproductModel",
verbose_name=_("product"),
on_delete=models.CASCADE,
related_name="variants"
)
firestore_id = models.CharField(verbose_name=_("firestore id"), max_length=255, unique=True, null=True, blank=True)
price = models.DecimalField(verbose_name=_("price"), max_digits=12, decimal_places=2, default=0)
sku = models.CharField(verbose_name=_("SKU"), max_length=255, null=True, blank=True)
quantity = models.IntegerField(verbose_name=_("quantity"), default=-1)
image_url = models.URLField(verbose_name=_("image url"), max_length=1000, null=True, blank=True)
attribute_data = models.JSONField(verbose_name=_("attribute data"), null=True, blank=True)
def __str__(self):
return f"Variant {self.sku} for {self.product.name}"
class Meta:
db_table = "product_variants"
verbose_name = _("Product Variant")
verbose_name_plural = _("Product Variants")