diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6c95206429702edd60ea1d68ba7cb72852299c57..bd49f36a4ea6855801f9dae5e82c6a318a60f17f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,7 @@ Added * Implement optional Sentry integration for error and performance tracing. * Option to limit allowed scopes per application, including mixin to enforce that limit on OAuth resource views * Support trusted OAuth applications that leave out the authorisation screen. +* Add birthplace to Person model. Changed ~~~~~~~ diff --git a/aleksis/core/forms.py b/aleksis/core/forms.py index dd695cd06ea2c0dbc862be8c9989047d9934c0c3..b89d677efed65c3066e713bf567c1197fb94edb7 100644 --- a/aleksis/core/forms.py +++ b/aleksis/core/forms.py @@ -49,7 +49,11 @@ class PersonForm(ExtensibleForm): Fieldset(_("Address"), Row("street", "housenumber"), Row("postal_code", "place")), Fieldset(_("Contact data"), "email", Row("phone_number", "mobile_number")), Fieldset( - _("Advanced personal data"), Row("sex", "date_of_birth"), Row("photo"), "guardians", + _("Advanced personal data"), + Row("date_of_birth", "place_of_birth"), + Row("sex"), + Row("photo"), + "guardians", ), ) @@ -70,6 +74,7 @@ class PersonForm(ExtensibleForm): "mobile_number", "email", "date_of_birth", + "place_of_birth", "sex", "photo", "guardians", diff --git a/aleksis/core/migrations/0027_person_place_of_birth.py b/aleksis/core/migrations/0027_person_place_of_birth.py new file mode 100644 index 0000000000000000000000000000000000000000..53c5bf169a3e852f6a83d9681bf6a9dd7666bb1d --- /dev/null +++ b/aleksis/core/migrations/0027_person_place_of_birth.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.8 on 2021-11-02 20:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0026_oauthapplication_allowed_scopes'), + ] + + operations = [ + migrations.AddField( + model_name='person', + name='place_of_birth', + field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place of birth'), + ), + ] diff --git a/aleksis/core/models.py b/aleksis/core/models.py index a78bfcc141d5539479983a50bbd257e6b7b7e5b1..c8eb85111e7ac9bfb0740e020b3a0df0ba825e13 100644 --- a/aleksis/core/models.py +++ b/aleksis/core/models.py @@ -194,6 +194,9 @@ class Person(ExtensibleModel): email = models.EmailField(verbose_name=_("E-mail address"), blank=True) date_of_birth = models.DateField(verbose_name=_("Date of birth"), blank=True, null=True) + place_of_birth = models.CharField( + verbose_name=_("Place of birth"), max_length=255, blank=True, null=True + ) sex = models.CharField(verbose_name=_("Sex"), max_length=1, choices=SEX_CHOICES, blank=True) photo = models.ImageField(verbose_name=_("Photo"), blank=True, null=True) diff --git a/aleksis/core/templates/core/person/full.html b/aleksis/core/templates/core/person/full.html index 6d48194665b2667df1bfdaf0a3c0d05a706c1d23..d16354f00ebcd2162ffc7bab16715707b41adb81 100644 --- a/aleksis/core/templates/core/person/full.html +++ b/aleksis/core/templates/core/person/full.html @@ -110,7 +110,8 @@ <td> <i class="material-icons small">cake</i> </td> - <td colspan="3">{{ person.date_of_birth|date }}</td> + <td colspan="2">{{ person.date_of_birth|date }}</td> + <td colspan="2">{{ person.place_of_birth }}</td> </tr> {% endif %} </table>