diff --git a/django/business_model_canvas_app/migrations/0001_initial.py b/django/business_model_canvas_app/migrations/0001_initial.py
new file mode 100644
index 0000000..5c800c3
--- /dev/null
+++ b/django/business_model_canvas_app/migrations/0001_initial.py
@@ -0,0 +1,264 @@
+# Generated by Django 4.1.7 on 2023-05-14 15:44
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+ initial = True
+
+ dependencies = []
+
+ operations = [
+ migrations.CreateModel(
+ name="BMCModelloDiBusiness",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("descrizione", models.CharField(max_length=4096, null=True)),
+ ],
+ options={
+ "verbose_name": "bmcmodellodibusiness",
+ "verbose_name_plural": "bmcmodellodibusiness",
+ },
+ ),
+ migrations.CreateModel(
+ name="BMCSegmentiDiClientela",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("settore_cliente", models.IntegerField(blank=True, null=True)),
+ (
+ "modello_di_business",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="BMCSegmentiDiClientela_da_BMCModelloDiBusiness_modello_di_business",
+ to="business_model_canvas_app.bmcmodellodibusiness",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "bmcsegmentidiclientela",
+ "verbose_name_plural": "bmcsegmentidiclientela",
+ },
+ ),
+ migrations.CreateModel(
+ name="BMCRisorsaChiave",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("risorsa_chiave", models.IntegerField(blank=True, null=True)),
+ (
+ "modello_di_business",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="BMCRisorsaChiave_da_BMCModelloDiBusiness_modello_di_business",
+ to="business_model_canvas_app.bmcmodellodibusiness",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "bmcrisorsachiave",
+ "verbose_name_plural": "bmcrisorsachiave",
+ },
+ ),
+ migrations.CreateModel(
+ name="BMCRelazioneConCliente",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("relazione_cliente", models.IntegerField(blank=True, null=True)),
+ (
+ "modello_di_business",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="BMCRelazioneConCliente_da_BMCModelloDiBusiness_modello_di_business",
+ to="business_model_canvas_app.bmcmodellodibusiness",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "bmcrelazioneconcliente",
+ "verbose_name_plural": "bmcrelazioneconcliente",
+ },
+ ),
+ migrations.CreateModel(
+ name="BMCPropostaDiValore",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("proposta_di_valore", models.IntegerField(blank=True, null=True)),
+ (
+ "modello_di_business",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="BMCPropostaDiValore_da_BMCModelloDiBusiness_modello_di_business",
+ to="business_model_canvas_app.bmcmodellodibusiness",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "bmcpropostadivalore",
+ "verbose_name_plural": "bmcpropostadivalore",
+ },
+ ),
+ migrations.CreateModel(
+ name="BMCPartnerChiave",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("partnership_azienda", models.IntegerField(blank=True, null=True)),
+ (
+ "modello_di_business",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="BMCPartnerChiave_da_BMCModelloDiBusiness_modello_di_business",
+ to="business_model_canvas_app.bmcmodellodibusiness",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "bmcpartnerchiave",
+ "verbose_name_plural": "bmcpartnerchiave",
+ },
+ ),
+ migrations.CreateModel(
+ name="BMCFlussoDiRicavi",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("flusso_di_ricavi", models.IntegerField(blank=True, null=True)),
+ (
+ "modello_di_business",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="BMCFlussoDiRicavi_da_BMCModelloDiBusiness_modello_di_business",
+ to="business_model_canvas_app.bmcmodellodibusiness",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "bmcflussodiricavi",
+ "verbose_name_plural": "bmcflussodiricavi",
+ },
+ ),
+ migrations.CreateModel(
+ name="BMCCanaleDiDistribuzione",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("canale", models.IntegerField(blank=True, null=True)),
+ (
+ "modello_di_business",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="BMCCanaleDiDistribuzione_da_BMCModelloDiBusiness_modello_di_business",
+ to="business_model_canvas_app.bmcmodellodibusiness",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "bmccanaledidistribuzione",
+ "verbose_name_plural": "bmccanaledidistribuzione",
+ },
+ ),
+ migrations.CreateModel(
+ name="BMCAttivitaChiave",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("attivita_chiave", models.IntegerField(blank=True, null=True)),
+ (
+ "modello_di_business",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="BMCAttivitaChiave_da_BMCModelloDiBusiness_modello_di_business",
+ to="business_model_canvas_app.bmcmodellodibusiness",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "bmcattivitachiave",
+ "verbose_name_plural": "bmcattivitachiave",
+ },
+ ),
+ ]
diff --git a/django/business_model_canvas_app/migrations/__init__.py b/django/business_model_canvas_app/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/django/contatti_app/migrations/0001_initial.py b/django/contatti_app/migrations/0001_initial.py
index 4842bf3..aa9b4f0 100644
--- a/django/contatti_app/migrations/0001_initial.py
+++ b/django/contatti_app/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.1.7 on 2023-05-14 13:47
+# Generated by Django 4.1.7 on 2023-05-14 15:43
from django.db import migrations, models
import django.db.models.deletion
@@ -14,7 +14,36 @@ class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
- name="ContattoRubrica",
+ name="SoggettoContattabile",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("rimosso", models.BooleanField(blank=True, null=True)),
+ (
+ "polymorphic_ctype",
+ models.ForeignKey(
+ editable=False,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="polymorphic_%(app_label)s.%(class)s_set+",
+ to="contenttypes.contenttype",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "soggetto contattabile",
+ "verbose_name_plural": "soggetti contattabili",
+ },
+ ),
+ migrations.CreateModel(
+ name="VoceContattoRubrica",
fields=[
(
"id",
@@ -35,22 +64,78 @@ class Migration(migrations.Migration):
to="contenttypes.contenttype",
),
),
+ (
+ "soggetto",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="contatti",
+ to="contatti_app.soggettocontattabile",
+ ),
+ ),
],
options={
"verbose_name": "contatto di rubrica",
"verbose_name_plural": "contatti di rubrica",
},
),
+ migrations.CreateModel(
+ name="Email",
+ fields=[
+ (
+ "vocecontattorubrica_ptr",
+ models.OneToOneField(
+ auto_created=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ parent_link=True,
+ primary_key=True,
+ serialize=False,
+ to="contatti_app.vocecontattorubrica",
+ ),
+ ),
+ ("indirizzo_email", models.CharField(max_length=30)),
+ ("note", models.CharField(max_length=64, null=True)),
+ ],
+ options={
+ "verbose_name": "email",
+ "verbose_name_plural": "email",
+ },
+ bases=("contatti_app.vocecontattorubrica",),
+ ),
+ migrations.CreateModel(
+ name="Fax",
+ fields=[
+ (
+ "vocecontattorubrica_ptr",
+ models.OneToOneField(
+ auto_created=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ parent_link=True,
+ primary_key=True,
+ serialize=False,
+ to="contatti_app.vocecontattorubrica",
+ ),
+ ),
+ ("numero", models.CharField(max_length=20, null=True)),
+ ("note", models.CharField(max_length=64, null=True)),
+ ],
+ options={
+ "verbose_name": "fax",
+ "verbose_name_plural": "fax",
+ },
+ bases=("contatti_app.vocecontattorubrica",),
+ ),
migrations.CreateModel(
name="Indirizzo",
fields=[
(
- "id",
- models.AutoField(
+ "vocecontattorubrica_ptr",
+ models.OneToOneField(
auto_created=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ parent_link=True,
primary_key=True,
serialize=False,
- verbose_name="ID",
+ to="contatti_app.vocecontattorubrica",
),
),
(
@@ -102,97 +187,13 @@ class Migration(migrations.Migration):
to="dati_geo_app.nazione",
),
),
- (
- "polymorphic_ctype",
- models.ForeignKey(
- editable=False,
- null=True,
- on_delete=django.db.models.deletion.CASCADE,
- related_name="polymorphic_%(app_label)s.%(class)s_set+",
- to="contenttypes.contenttype",
- ),
- ),
],
options={
"verbose_name": "indirizzo",
"verbose_name_plural": "indirizzi",
"abstract": False,
},
- ),
- migrations.CreateModel(
- name="SoggettoContattabile",
- fields=[
- (
- "id",
- models.AutoField(
- auto_created=True,
- primary_key=True,
- serialize=False,
- verbose_name="ID",
- ),
- ),
- ("rimosso", models.BooleanField(blank=True, null=True)),
- (
- "polymorphic_ctype",
- models.ForeignKey(
- editable=False,
- null=True,
- on_delete=django.db.models.deletion.CASCADE,
- related_name="polymorphic_%(app_label)s.%(class)s_set+",
- to="contenttypes.contenttype",
- ),
- ),
- ],
- options={
- "verbose_name": "soggetto contattabile",
- "verbose_name_plural": "soggetti contattabili",
- },
- ),
- migrations.CreateModel(
- name="Email",
- fields=[
- (
- "contattorubrica_ptr",
- models.OneToOneField(
- auto_created=True,
- on_delete=django.db.models.deletion.CASCADE,
- parent_link=True,
- primary_key=True,
- serialize=False,
- to="contatti_app.contattorubrica",
- ),
- ),
- ("indirizzo", models.CharField(max_length=30)),
- ("note", models.CharField(max_length=64, null=True)),
- ],
- options={
- "verbose_name": "email",
- "verbose_name_plural": "email",
- },
- bases=("contatti_app.contattorubrica",),
- ),
- migrations.CreateModel(
- name="Fax",
- fields=[
- (
- "contattorubrica_ptr",
- models.OneToOneField(
- auto_created=True,
- on_delete=django.db.models.deletion.CASCADE,
- parent_link=True,
- primary_key=True,
- serialize=False,
- to="contatti_app.contattorubrica",
- ),
- ),
- ("numero", models.CharField(max_length=20, null=True)),
- ("note", models.CharField(max_length=64, null=True)),
- ],
- options={
- "verbose_name": "fax",
- "verbose_name_plural": "fax",
- },
- bases=("contatti_app.contattorubrica",),
+ bases=("contatti_app.vocecontattorubrica", models.Model),
),
migrations.CreateModel(
name="PersonaFisica",
@@ -240,49 +241,18 @@ class Migration(migrations.Migration):
},
bases=("contatti_app.soggettocontattabile",),
),
- migrations.CreateModel(
- name="Residenza",
- fields=[
- (
- "indirizzo_ptr",
- models.OneToOneField(
- auto_created=True,
- on_delete=django.db.models.deletion.CASCADE,
- parent_link=True,
- primary_key=True,
- serialize=False,
- to="contatti_app.indirizzo",
- ),
- ),
- (
- "inquilino",
- models.ForeignKey(
- blank=True,
- null=True,
- on_delete=django.db.models.deletion.CASCADE,
- related_name="residenze",
- to="contatti_app.soggettocontattabile",
- ),
- ),
- ],
- options={
- "verbose_name": "residenza",
- "verbose_name_plural": "residenze",
- },
- bases=("contatti_app.indirizzo",),
- ),
migrations.CreateModel(
name="Telefono",
fields=[
(
- "contattorubrica_ptr",
+ "vocecontattorubrica_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
- to="contatti_app.contattorubrica",
+ to="contatti_app.vocecontattorubrica",
),
),
("numero", models.CharField(max_length=20)),
@@ -293,7 +263,7 @@ class Migration(migrations.Migration):
"verbose_name": "telefono",
"verbose_name_plural": "telefono",
},
- bases=("contatti_app.contattorubrica",),
+ bases=("contatti_app.vocecontattorubrica",),
),
migrations.CreateModel(
name="Societa",
@@ -308,7 +278,6 @@ class Migration(migrations.Migration):
),
),
("ragione_sociale", models.CharField(max_length=1024)),
- ("sede_legale", models.IntegerField()),
(
"nazione",
models.ForeignKey(
@@ -333,15 +302,6 @@ class Migration(migrations.Migration):
"verbose_name_plural": "societa",
},
),
- migrations.AddField(
- model_name="contattorubrica",
- name="soggetto",
- field=models.ForeignKey(
- on_delete=django.db.models.deletion.CASCADE,
- related_name="contatti",
- to="contatti_app.soggettocontattabile",
- ),
- ),
migrations.CreateModel(
name="Pec",
fields=[
@@ -367,14 +327,14 @@ class Migration(migrations.Migration):
name="Sede",
fields=[
(
- "residenza_ptr",
+ "indirizzo_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
- to="contatti_app.residenza",
+ to="contatti_app.indirizzo",
),
),
("is_legale", models.BooleanField(blank=True, null=True)),
@@ -393,7 +353,7 @@ class Migration(migrations.Migration):
"verbose_name": "sede",
"verbose_name_plural": "sedi",
},
- bases=("contatti_app.residenza",),
+ bases=("contatti_app.indirizzo",),
),
migrations.CreateModel(
name="PersonaContattoAzienda",
diff --git a/django/contatti_app/migrations/0002_personafisica_is_privato.py b/django/contatti_app/migrations/0002_personafisica_is_privato.py
new file mode 100644
index 0000000..680d83b
--- /dev/null
+++ b/django/contatti_app/migrations/0002_personafisica_is_privato.py
@@ -0,0 +1,17 @@
+# Generated by Django 4.1.7 on 2023-05-14 16:19
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("contatti_app", "0001_initial"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="personafisica",
+ name="is_privato",
+ field=models.BooleanField(default=True),
+ ),
+ ]
diff --git a/django/contatti_app/modello_database.xml b/django/contatti_app/modello_database.xml
index ad482ba..605a295 100644
--- a/django/contatti_app/modello_database.xml
+++ b/django/contatti_app/modello_database.xml
@@ -37,78 +37,66 @@