From 735bdd0a0a480072122c46a196ec6a83e31ac319 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 14 Dec 2023 15:25:54 +0000 Subject: [PATCH] add start and end date to person model This is to enable use to indicate when an MP's term has expired. --- .../0059_person_end_date_person_start_date.py | 23 +++++++++++++++++++ hub/models.py | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 hub/migrations/0059_person_end_date_person_start_date.py diff --git a/hub/migrations/0059_person_end_date_person_start_date.py b/hub/migrations/0059_person_end_date_person_start_date.py new file mode 100644 index 000000000..0269df60b --- /dev/null +++ b/hub/migrations/0059_person_end_date_person_start_date.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.5 on 2023-12-14 15:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("hub", "0058_areaoverlap_area_overlaps"), + ] + + operations = [ + migrations.AddField( + model_name="person", + name="end_date", + field=models.DateField(null=True), + ), + migrations.AddField( + model_name="person", + name="start_date", + field=models.DateField(null=True), + ), + ] diff --git a/hub/models.py b/hub/models.py index 7fe9af54a..c1e0bf055 100644 --- a/hub/models.py +++ b/hub/models.py @@ -587,6 +587,8 @@ class Person(models.Model): name = models.CharField(max_length=200) area = models.ForeignKey(Area, on_delete=models.CASCADE) photo = models.ImageField(null=True, upload_to="person") + start_date = models.DateField(null=True) + end_date = models.DateField(null=True) def __str__(self): return self.name