Fixes: 1) Fix email validation to properly handle `self.instance` checks in serializers; Extra: 1) Remove unnecessary blank lines and reformat code for better readability; 2) Consolidate migration field definitions to a single line for cleaner diff;
153 lines
5.6 KiB
Python
153 lines
5.6 KiB
Python
# Generated by Django 5.2 on 2025-09-06 22:05
|
|
|
|
import django.db.models.deletion
|
|
import django_extensions.db.fields
|
|
import django_prometheus.models
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
("core", "0039_alter_product_sku"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="CustomerRelationshipManagementProvider",
|
|
fields=[
|
|
(
|
|
"uuid",
|
|
models.UUIDField(
|
|
default=uuid.uuid4,
|
|
editable=False,
|
|
help_text="unique id is used to surely identify any database object",
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="unique id",
|
|
),
|
|
),
|
|
(
|
|
"is_active",
|
|
models.BooleanField(
|
|
default=True,
|
|
help_text="if set to false, this object can't be seen by users without needed permission",
|
|
verbose_name="is active",
|
|
),
|
|
),
|
|
(
|
|
"created",
|
|
django_extensions.db.fields.CreationDateTimeField(
|
|
auto_now_add=True,
|
|
help_text="when the object first appeared on the database",
|
|
verbose_name="created",
|
|
),
|
|
),
|
|
(
|
|
"modified",
|
|
django_extensions.db.fields.ModificationDateTimeField(
|
|
auto_now=True,
|
|
help_text="when the object was last modified",
|
|
verbose_name="modified",
|
|
),
|
|
),
|
|
(
|
|
"name",
|
|
models.CharField(max_length=128, unique=True, verbose_name="name"),
|
|
),
|
|
(
|
|
"integration_url",
|
|
models.URLField(blank=True, help_text="URL of the integration", null=True),
|
|
),
|
|
(
|
|
"authentication",
|
|
models.JSONField(blank=True, help_text="authentication credentials", null=True),
|
|
),
|
|
(
|
|
"attributes",
|
|
models.JSONField(blank=True, null=True, verbose_name="attributes"),
|
|
),
|
|
(
|
|
"integration_location",
|
|
models.CharField(blank=True, max_length=128, null=True),
|
|
),
|
|
("default", models.BooleanField(default=False)),
|
|
],
|
|
options={
|
|
"verbose_name": "order CRM link",
|
|
"verbose_name_plural": "orders CRM links",
|
|
},
|
|
bases=(
|
|
django_prometheus.models.ExportModelOperationsMixin("crm_provider"),
|
|
models.Model,
|
|
),
|
|
),
|
|
migrations.CreateModel(
|
|
name="OrderCrmLink",
|
|
fields=[
|
|
(
|
|
"uuid",
|
|
models.UUIDField(
|
|
default=uuid.uuid4,
|
|
editable=False,
|
|
help_text="unique id is used to surely identify any database object",
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="unique id",
|
|
),
|
|
),
|
|
(
|
|
"is_active",
|
|
models.BooleanField(
|
|
default=True,
|
|
help_text="if set to false, this object can't be seen by users without needed permission",
|
|
verbose_name="is active",
|
|
),
|
|
),
|
|
(
|
|
"created",
|
|
django_extensions.db.fields.CreationDateTimeField(
|
|
auto_now_add=True,
|
|
help_text="when the object first appeared on the database",
|
|
verbose_name="created",
|
|
),
|
|
),
|
|
(
|
|
"modified",
|
|
django_extensions.db.fields.ModificationDateTimeField(
|
|
auto_now=True,
|
|
help_text="when the object was last modified",
|
|
verbose_name="modified",
|
|
),
|
|
),
|
|
(
|
|
"crm_lead_id",
|
|
models.CharField(db_index=True, max_length=30, unique=True),
|
|
),
|
|
(
|
|
"crm",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
related_name="order_links",
|
|
to="core.customerrelationshipmanagementprovider",
|
|
),
|
|
),
|
|
(
|
|
"order",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
related_name="crm_links",
|
|
to="core.order",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "order CRM link",
|
|
"verbose_name_plural": "orders CRM links",
|
|
},
|
|
bases=(
|
|
django_prometheus.models.ExportModelOperationsMixin("order_crm_link"),
|
|
models.Model,
|
|
),
|
|
),
|
|
]
|