Skip to content

Commit

Permalink
permettre les champs vide dans l'admin du model Programme (#1562)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolok committed Sep 4, 2024
1 parent 86a6e76 commit e8cbfb9
Show file tree
Hide file tree
Showing 14 changed files with 749 additions and 220 deletions.
108 changes: 0 additions & 108 deletions programmes/fixtures/programmes_for_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"model": "programmes.programme",
"pk": 1,
"fields": {
"parent": null,
"uuid": "c3449e15-3739-4a35-8587-09be8c5ee007",
"nom": "Programme 1",
"numero_operation": "12345",
Expand All @@ -12,9 +11,7 @@
"adresse": "22 rue segur",
"code_postal": "75007",
"ville": "Paris",
"code_insee_commune": null,
"code_insee_departement": "75",
"code_insee_region": null,
"annee_gestion_programmation": 2018,
"zone_123": "3",
"zone_abc": "B1",
Expand All @@ -25,28 +22,14 @@
"nb_locaux_commerciaux": 5,
"nb_bureaux": 25,
"autres_locaux_hors_convention": "quelques uns",
"vendeur": "",
"acquereur": null,
"date_acte_notarie": null,
"reference_notaire": "",
"reference_publication_acte": "{\"text\": \"this is a test\", \"files\": {\"8c9b6894-1de4-4b45-bd50-e9416dd3ee6b\": {\"uuid\": \"8c9b6894-1de4-4b45-bd50-e9416dd3ee6b\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"0c48af64-c852-4e6f-ae86-265615913ac9\": {\"uuid\": \"0c48af64-c852-4e6f-ae86-265615913ac9\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"acte_de_propriete": "",
"effet_relatif": "n'importe quoi",
"certificat_adressage": "n'importe quoi",
"reference_cadastrale": "{\"text\": \"this is a test\", \"files\": {\"98ae5093-ff07-4008-bb61-6fa5e7e34fd2\": {\"uuid\": \"98ae5093-ff07-4008-bb61-6fa5e7e34fd2\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"daf5cc14-e5fd-4125-affa-3d7003b1dcc8\": {\"uuid\": \"daf5cc14-e5fd-4125-affa-3d7003b1dcc8\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"edd_volumetrique": null,
"mention_publication_edd_volumetrique": null,
"edd_classique": null,
"mention_publication_edd_classique": null,
"permis_construire": "123 456 789 ABC",
"date_achevement_previsible": "2024-01-02",
"date_achat": "2022-01-02",
"date_achevement": "2024-04-11",
"date_autorisation_hors_habitat_inclusif": null,
"date_convention_location": null,
"date_residence_argement_gestionnaire_intermediation": null,
"departement_residence_argement_gestionnaire_intermediation": null,
"ville_signature_residence_agrement_gestionnaire_intermediation": null,
"date_achevement_compile": "2024-04-11",
"cree_le": "2023-03-08T20:43:46.064Z",
"mis_a_jour_le": "2023-03-08T20:43:46.064Z"
Expand All @@ -56,7 +39,6 @@
"model": "programmes.programme",
"pk": 2,
"fields": {
"parent": null,
"uuid": "0bc134b9-4f50-4c2a-a858-e4696c121ff0",
"nom": "Programme 1",
"numero_operation": "98765",
Expand All @@ -65,9 +47,7 @@
"adresse": "22 rue segur",
"code_postal": "13001",
"ville": "Paris",
"code_insee_commune": null,
"code_insee_departement": "13",
"code_insee_region": null,
"annee_gestion_programmation": 2018,
"zone_123": "3",
"zone_abc": "B1",
Expand All @@ -80,26 +60,14 @@
"autres_locaux_hors_convention": "quelques uns",
"vendeur": "{\"text\": \"this is a test\", \"files\": {\"cff0c56e-40bd-409b-8116-d50430db2239\": {\"uuid\": \"cff0c56e-40bd-409b-8116-d50430db2239\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"a94a4c00-1ee1-4fbd-b200-a758379ec37f\": {\"uuid\": \"a94a4c00-1ee1-4fbd-b200-a758379ec37f\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"acquereur": "n'importe quoi",
"date_acte_notarie": null,
"reference_notaire": "{\"text\": \"this is a test\", \"files\": {\"45079d28-f737-44b7-9f6a-c1e8367072a5\": {\"uuid\": \"45079d28-f737-44b7-9f6a-c1e8367072a5\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"df747b0d-62c7-4fb3-9fda-37f3b682df80\": {\"uuid\": \"df747b0d-62c7-4fb3-9fda-37f3b682df80\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"reference_publication_acte": "{\"text\": \"this is a test\", \"files\": {\"80ecbde5-da41-4ece-a35b-19665b8b2b12\": {\"uuid\": \"80ecbde5-da41-4ece-a35b-19665b8b2b12\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"ae57c1f9-62cb-46df-b496-2f4c78429a4c\": {\"uuid\": \"ae57c1f9-62cb-46df-b496-2f4c78429a4c\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"acte_de_propriete": "{\"text\": \"this is a test\", \"files\": {\"8f25d1cd-cb65-4596-9f74-758c6eb00283\": {\"uuid\": \"8f25d1cd-cb65-4596-9f74-758c6eb00283\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"4a5ca2ab-f739-4b9d-ba71-4412268e78f4\": {\"uuid\": \"4a5ca2ab-f739-4b9d-ba71-4412268e78f4\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"effet_relatif": null,
"certificat_adressage": "{\"text\": \"this is a test\", \"files\": {\"4feccfda-205e-42de-b215-46e94b32ddd1\": {\"uuid\": \"4feccfda-205e-42de-b215-46e94b32ddd1\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"6441b179-5ec6-4ca5-bb64-f915f83c34ab\": {\"uuid\": \"6441b179-5ec6-4ca5-bb64-f915f83c34ab\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"reference_cadastrale": "",
"edd_volumetrique": null,
"mention_publication_edd_volumetrique": null,
"edd_classique": null,
"mention_publication_edd_classique": null,
"permis_construire": "123 456 789 ABC",
"date_achevement_previsible": "2024-01-02",
"date_achat": "2022-01-02",
"date_achevement": "2024-04-11",
"date_autorisation_hors_habitat_inclusif": null,
"date_convention_location": null,
"date_residence_argement_gestionnaire_intermediation": null,
"departement_residence_argement_gestionnaire_intermediation": null,
"ville_signature_residence_agrement_gestionnaire_intermediation": null,
"date_achevement_compile": "2024-04-11",
"cree_le": "2023-03-08T20:43:46.137Z",
"mis_a_jour_le": "2023-03-08T20:43:46.137Z"
Expand All @@ -109,32 +77,13 @@
"model": "programmes.lot",
"pk": 1,
"fields": {
"parent": null,
"uuid": "09b07c04-a46a-4d41-a463-71b00c2d38ac",
"nb_logements": null,
"programme": 1,
"financement": "PLAI",
"type_habitat": "INDIVIDUEL",
"edd_volumetrique": "",
"edd_classique": "{\"text\": \"this is a test\", \"files\": {\"fbb9890f-171b-402d-a35e-71e1bd791b70\": {\"uuid\": \"fbb9890f-171b-402d-a35e-71e1bd791b70\", \"thumbnail\": \"data:image/png;base64,BLAHBLAH==\", \"size\": \"31185\", \"filename\": \"acquereur1.png\", \"content_type\": \"image/png\"}, \"dccd310d-2e50-45d8-a477-db7b08ae1d71\": {\"uuid\": \"dccd310d-2e50-45d8-a477-db7b08ae1d71\", \"thumbnail\": \"data:image/png;base64,BLIHBLIH==\", \"size\": \"69076\", \"filename\": \"acquereur2.png\", \"content_type\": \"image/png\"}}}",
"annexe_caves": false,
"annexe_soussols": false,
"annexe_remises": false,
"annexe_ateliers": false,
"annexe_sechoirs": false,
"annexe_celliers": false,
"annexe_resserres": false,
"annexe_combles": false,
"annexe_balcons": false,
"annexe_loggias": false,
"annexe_terrasses": false,
"lgts_mixite_sociale_negocies": 0,
"loyer_derogatoire": null,
"surface_habitable_totale": null,
"surface_locaux_collectifs_residentiels": 0,
"foyer_residence_nb_garage_parking": null,
"foyer_residence_dependance": null,
"foyer_residence_locaux_hors_convention": null,
"cree_le": "2023-03-08T20:43:46.080Z",
"mis_a_jour_le": "2023-03-08T20:43:46.080Z"
}
Expand All @@ -143,32 +92,13 @@
"model": "programmes.lot",
"pk": 2,
"fields": {
"parent": null,
"uuid": "3918d6f7-fcee-42c2-aa81-c56b97e802fb",
"nb_logements": null,
"programme": 1,
"financement": "PLUS",
"type_habitat": "INDIVIDUEL",
"edd_volumetrique": "",
"edd_classique": "n'importe quoi",
"annexe_caves": false,
"annexe_soussols": false,
"annexe_remises": false,
"annexe_ateliers": false,
"annexe_sechoirs": false,
"annexe_celliers": false,
"annexe_resserres": false,
"annexe_combles": false,
"annexe_balcons": false,
"annexe_loggias": false,
"annexe_terrasses": false,
"lgts_mixite_sociale_negocies": 0,
"loyer_derogatoire": null,
"surface_habitable_totale": null,
"surface_locaux_collectifs_residentiels": 0,
"foyer_residence_nb_garage_parking": null,
"foyer_residence_dependance": null,
"foyer_residence_locaux_hors_convention": null,
"cree_le": "2023-03-08T20:43:46.095Z",
"mis_a_jour_le": "2023-03-08T20:43:46.095Z"
}
Expand All @@ -177,32 +107,12 @@
"model": "programmes.lot",
"pk": 3,
"fields": {
"parent": null,
"uuid": "3cabcbcd-9cf0-4cb8-8170-27be8e9e159c",
"nb_logements": null,
"programme": 2,
"financement": "PLAI",
"type_habitat": "INDIVIDUEL",
"edd_volumetrique": "",
"edd_classique": null,
"annexe_caves": false,
"annexe_soussols": false,
"annexe_remises": false,
"annexe_ateliers": false,
"annexe_sechoirs": false,
"annexe_celliers": false,
"annexe_resserres": false,
"annexe_combles": false,
"annexe_balcons": false,
"annexe_loggias": false,
"annexe_terrasses": false,
"lgts_mixite_sociale_negocies": 0,
"loyer_derogatoire": null,
"surface_habitable_totale": null,
"surface_locaux_collectifs_residentiels": 0,
"foyer_residence_nb_garage_parking": null,
"foyer_residence_dependance": null,
"foyer_residence_locaux_hors_convention": null,
"cree_le": "2023-03-08T20:43:46.144Z",
"mis_a_jour_le": "2023-03-08T20:43:46.144Z"
}
Expand All @@ -211,32 +121,14 @@
"model": "programmes.lot",
"pk": 4,
"fields": {
"parent": null,
"uuid": "3be91b08-5bb7-4c03-95a8-168e6602ac91",
"nb_logements": null,
"programme": 2,
"financement": "PLUS",
"type_habitat": "COLLECTIF",
"edd_volumetrique": "n'importe quoi",
"edd_classique": "n'importe quoi",
"annexe_caves": false,
"annexe_soussols": false,
"annexe_remises": false,
"annexe_ateliers": false,
"annexe_sechoirs": false,
"annexe_celliers": false,
"annexe_resserres": false,
"annexe_combles": false,
"annexe_balcons": false,
"annexe_loggias": false,
"annexe_terrasses": false,
"lgts_mixite_sociale_negocies": 0,
"loyer_derogatoire": null,
"surface_habitable_totale": null,
"surface_locaux_collectifs_residentiels": 0,
"foyer_residence_nb_garage_parking": null,
"foyer_residence_dependance": null,
"foyer_residence_locaux_hors_convention": null,
"cree_le": "2023-03-08T20:43:46.150Z",
"mis_a_jour_le": "2023-03-08T20:43:46.150Z"
}
Expand Down
98 changes: 98 additions & 0 deletions programmes/migrations/0102_alter_logement_blank_and_null.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Generated by Django 4.2.13 on 2024-09-03 20:37

from django.db import migrations, models


class Migration(migrations.Migration):

atomic = False

dependencies = [
("instructeurs", "0001_initial_squashed_0017_auto_20230925_1209"),
("programmes", "0101_programme_reassign_command_old_admin_backup"),
]

operations = [
migrations.AlterField(
model_name="logement",
name="coeficient",
field=models.DecimalField(
blank=True,
decimal_places=4,
max_digits=12,
null=True,
verbose_name="Coefficient propre au logement",
),
),
migrations.AlterField(
model_name="logement",
name="loyer",
field=models.DecimalField(
blank=True, decimal_places=2, max_digits=12, null=True
),
),
migrations.AlterField(
model_name="logement",
name="loyer_par_metre_carre",
field=models.DecimalField(
blank=True,
decimal_places=2,
max_digits=12,
null=True,
verbose_name="Loyer maximum en € par m² de surface utile",
),
),
migrations.AlterField(
model_name="logement",
name="surface_annexes",
field=models.DecimalField(
blank=True, decimal_places=2, max_digits=12, null=True
),
),
migrations.AlterField(
model_name="logement",
name="surface_annexes_retenue",
field=models.DecimalField(
blank=True, decimal_places=2, max_digits=12, null=True
),
),
migrations.AlterField(
model_name="logement",
name="surface_corrigee",
field=models.DecimalField(
blank=True,
decimal_places=2,
max_digits=12,
null=True,
verbose_name="Surface corrigée",
),
),
migrations.AlterField(
model_name="logement",
name="surface_habitable",
field=models.DecimalField(
blank=True,
decimal_places=2,
max_digits=12,
null=True,
verbose_name="Surface habitable",
),
),
migrations.AlterField(
model_name="logement",
name="surface_utile",
field=models.DecimalField(
blank=True,
decimal_places=2,
max_digits=12,
null=True,
verbose_name="Surface utile",
),
),
migrations.AlterField(
model_name="logementedd",
name="numero_lot",
field=models.CharField(blank=True, default="", max_length=255),
preserve_default=False,
),
]
62 changes: 62 additions & 0 deletions programmes/migrations/0103_alter_lot_blank_and_null.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Generated by Django 4.2.13 on 2024-09-03 20:37

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

atomic = False

dependencies = [
("instructeurs", "0001_initial_squashed_0017_auto_20230925_1209"),
("programmes", "0102_alter_logement_blank_and_null"),
]

operations = [
migrations.AlterField(
model_name="lot",
name="edd_classique",
field=models.TextField(blank=True, default="", max_length=50000),
preserve_default=False,
),
migrations.AlterField(
model_name="lot",
name="edd_volumetrique",
field=models.TextField(blank=True, default="", max_length=50000),
preserve_default=False,
),
migrations.AlterField(
model_name="lot",
name="loyer_derogatoire",
field=models.DecimalField(
blank=True,
decimal_places=2,
max_digits=6,
null=True,
verbose_name="Loyer dérogatoire",
),
),
migrations.AlterField(
model_name="lot",
name="nb_logements",
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name="lot",
name="parent",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="programmes.lot",
),
),
migrations.AlterField(
model_name="lot",
name="surface_habitable_totale",
field=models.DecimalField(
blank=True, decimal_places=2, max_digits=12, null=True
),
),
]
Loading

0 comments on commit e8cbfb9

Please sign in to comment.