-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🗃️ [#64] added digitaal adres model field
- Loading branch information
1 parent
f03b4d5
commit 4ce519b
Showing
5 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
src/openklant/components/klantinteracties/migrations/0004_digitaaladres.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Generated by Django 3.2.18 on 2023-10-11 15:47 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("klantinteracties", "0003_betrokkene"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="DigitaalAdres", | ||
fields=[ | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, | ||
help_text="Unieke (technische) identificatiecode van het digitaal adres.", | ||
primary_key=True, | ||
serialize=False, | ||
unique=True, | ||
), | ||
), | ||
( | ||
"soort_digitaal_adres", | ||
models.CharField( | ||
help_text="Typering van het digitale adres die aangeeft via welk(e) kanaal of kanalen met dit adres contact kan worden opgenomen.", | ||
max_length=254, | ||
verbose_name="Soort digitaal adres", | ||
), | ||
), | ||
( | ||
"adres", | ||
models.CharField( | ||
help_text="Digitaal adres waarmee een persoon of organisatie bereikt kan worden.", | ||
max_length=80, | ||
verbose_name="Adres", | ||
), | ||
), | ||
( | ||
"omschrijving", | ||
models.CharField( | ||
help_text="Omschrijving van het digitaal adres.", | ||
max_length=40, | ||
verbose_name="Omschrijving", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "digitaal adres", | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name="betrokkene", | ||
name="digitaal_adres", | ||
field=models.ForeignKey( | ||
help_text="'Digitaal Adres' had 'Betrokkene bij klantcontact'", | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="partijen", | ||
to="klantinteracties.digitaaladres", | ||
verbose_name="Digitaal adres", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="partij", | ||
name="digitaal_adres", | ||
field=models.ForeignKey( | ||
help_text="'Digitaal Adres' was 'Partij'", | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="digitale_adressen", | ||
to="klantinteracties.digitaaladres", | ||
verbose_name="Digitaal adres", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .digitaal_adres import * # noqa | ||
from .klantcontacten import * # noqa | ||
from .partijen import * # noqa |
39 changes: 39 additions & 0 deletions
39
src/openklant/components/klantinteracties/models/digitaal_adres.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import uuid | ||
|
||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class DigitaalAdres(models.Model): | ||
id = models.UUIDField( | ||
primary_key=True, | ||
unique=True, | ||
default=uuid.uuid4, | ||
help_text=_("Unieke (technische) identificatiecode van het digitaal adres."), | ||
) | ||
soort_digitaal_adres = models.CharField( | ||
_("Soort digitaal adres"), | ||
help_text=_( | ||
"Typering van het digitale adres die aangeeft via welk(e) kanaal of kanalen " | ||
"met dit adres contact kan worden opgenomen." | ||
), | ||
max_length=254, | ||
) | ||
adres = models.CharField( | ||
_("Adres"), | ||
help_text=_( | ||
"Digitaal adres waarmee een persoon of organisatie bereikt kan worden." | ||
), | ||
max_length=80, | ||
) | ||
omschrijving = models.CharField( | ||
_("Omschrijving"), | ||
help_text=_("Omschrijving van het digitaal adres."), | ||
max_length=40, | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("digitaal adres") | ||
|
||
def __str__(self): | ||
return self.adres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters